Skip to content

Commit

Permalink
test for 714
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Sep 6, 2016
1 parent 21e250b commit 92a3e51
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions ion/test/src/com/koushikdutta/ion/test/Issues.java
Original file line number Diff line number Diff line change
Expand Up @@ -343,4 +343,26 @@ public void testIssueVerso() throws Exception {
.asByteArray()
.get();
}

public void testIssue714() throws Exception {
AsyncHttpServer server = new AsyncHttpServer();
server.post("/test", new HttpServerRequestCallback() {
@Override
public void onRequest(AsyncHttpServerRequest request, AsyncHttpServerResponse response) {
response.send(request.getHeaders().get("Authorization"));
}
});
int port = server.listen(Ion.getDefault(getContext()).getServer(), 0).getLocalPort();
String auth = "";
for (int i = 0; i < 2048; i++) {
auth += (char)('0' + (i % 10));
}
System.out.println(auth);
assertEquals(auth, Ion.with(getContext())
.load("http://localhost:" + port + "/test")
.setHeader("Authorization", auth)
.setStringBody("testtest")
.asString()
.get());
}
}

0 comments on commit 92a3e51

Please sign in to comment.