Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added method to ensure that reponse headers are correclty cased befor… #53

Conversation

OGKevin
Copy link
Contributor

@OGKevin OGKevin commented Dec 21, 2017

Closes #43

@OGKevin OGKevin added this to the 0.12.4 milestone Dec 21, 2017
@OGKevin OGKevin self-assigned this Dec 21, 2017
Copy link
Contributor Author

@OGKevin OGKevin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No wild imports.

import org.apache.http.Header;
import org.apache.http.HttpEntityEnclosingRequest;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.*;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wild

/**
* Substring constants.
*/
private static final int SUBSTRING_BEGIN_INDEX = 0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Constants can have better names, have no clue what this is about. If we would add a second substring with different params it would be really confusing.

@@ -486,6 +521,21 @@ public static void validateResponseSignature(int responseCode, byte[] responseBo
return outputStream.toByteArray();
}

private static String ensureHeaderCorrectlyCased(String headerName) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ernsure sounds like we're asserting, while this would return a value.

@patrickdw1991
Copy link

@andrederoos

@andrederoos andrederoos merged commit 8c9387d into develop Dec 21, 2017
@andrederoos andrederoos deleted the feature/make_sure_headers_are_correctly_cased_bunq/sdk_java#43 branch December 21, 2017 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants