Skip to content

Commit

Permalink
debug more
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahchen6 committed Dec 6, 2024
1 parent 2223375 commit 4e31acf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ class TestHttpServer implements AutoCloseable {
clone.resolveStrategy = Closure.DELEGATE_FIRST

try {
clone(api) // come back to here!!!
clone(api)
} catch (Exception e) {
api.response.status(500).send(e.getMessage())
e.printStackTrace()
Expand Down Expand Up @@ -503,19 +503,10 @@ class TestHttpServer implements AutoCloseable {
static class Headers {
private final Map<String, String> headers

// FIX THIS...... setting header to wrong value, but also fails when header is hardcoded to correct value
private Headers(Request request) {
this.headers = [:]
request.getHeaderNames().each {
String tag = request.getHeader(it)
System.out.println("tag: " + tag)
if (tag == "foo,bar") {
headers.put(it, "foo,bar,baz")
System.out.println("set " + it + " to " + headers.get(it))
} else {
headers.put(it, tag)
}
// headers.put(it, request.getHeader(it))
headers.put(it, request.getHeader(it))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ public void forEachKey(
System.out.println("value: " + carrier.getHeader(header));
System.out.println("========= END ACCEPT IS CALLED HERE =========");
}
// ISSUE HERE
// `getHeader` in Request.class:604 calls `get` in HttpFields.class:164
// which returns only the first value for the header, instead of all values
// for the header name.
if (!classifier.accept(header, carrier.getHeader(header))) {
return;
}
Expand Down

0 comments on commit 4e31acf

Please sign in to comment.