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

Preserve REST client auth despite 401 response #30558

Merged
merged 5 commits into from
May 17, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'master' into rest-client/auth-cache
tvernum committed May 15, 2018
commit 26cfd20ff06e389a5fcdecaf7b1bf81a5754c738
Original file line number Diff line number Diff line change
@@ -377,11 +377,13 @@ private Response bodyTest(final RestClient restClient, final String method) thro

private Response bodyTest(RestClient restClient, String method, int statusCode, Header[] headers) throws IOException {
String requestBody = "{ \"field\": \"value\" }";
StringEntity entity = new StringEntity(requestBody, ContentType.APPLICATION_JSON);
Request request = new Request(method, "/" + statusCode);
request.setJsonEntity(requestBody);
request.setHeaders(headers);
Response esResponse;
try {
esResponse = restClient.performRequest(method, "/" + statusCode, Collections.<String, String>emptyMap(), entity, headers);
} catch (ResponseException e) {
esResponse = restClient.performRequest(request);
} catch(ResponseException e) {
esResponse = e.getResponse();
}
assertEquals(method, esResponse.getRequestLine().getMethod());
You are viewing a condensed version of this merge commit. You can view the full changes here.