Skip to content

OnSystemRequest has a lot of bugs #86

Closed
@mikeburke106

Description

@mikeburke106

OnSystemRequest doesn't really follow the guidelines and practices of the rest of the project. It seems like it was hurriedly thrown together and therefore, it has a lot of bugs.

I can see here that the class is attempting to create a JSON object from the binary bulk data. If the BulkData is valid, it will save 2 global variables, httpreqparams and myJSONObj. If the bulk data is not valid, both of these variables will be null.

In the setHeaders method, if the httpreqparams is null, it will cause a NullPointerException crash.

The body of the request is even more confusing. In the getBody method, it is trying to read from httpreqparams if that's not null. Even though httpreqparams is already the object returned from the "HTTPRequest" key, the code is reading the exact same value from the original bulk data and then reading the "body" key from that. If the httpreqparams is null, the code just returns the original bulk data as a string, which I don't really understand. Why are we just blindly assuming that whatever is in the bulk data is the body of an HTTP request in this one case? In addition, in the setBody method, the body information is stored in the parameters hashtable, which isn't even where it came from and obviously doesn't belong here.

I think this whole class should be re-written, to be honest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    REVIEW - scheduledThe reviewer has scheduled a review of this PR for the current sprintbugA defect in the library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions