forked from jooby-project/jooby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIssue2357.java
More file actions
23 lines (20 loc) · 906 Bytes
/
Copy pathIssue2357.java
File metadata and controls
23 lines (20 loc) · 906 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package io.jooby;
import io.jooby.junit.ServerTest;
import io.jooby.junit.ServerTestRunner;
import org.junit.jupiter.api.Assertions;
class Issue2357 {
@ServerTest
public void headersShouldBeCaseInsensitive(ServerTestRunner runner) {
runner.define(app -> app.get("/", ctx -> {
Assertions.assertEquals("value1", ctx.header().get("x-header1").value());
Assertions.assertEquals("value1", ctx.header().get("X-HEADER1").value());
Assertions.assertEquals("value1", ctx.header().get("X-hEaDeR1").value());
Assertions.assertEquals("value1", ctx.header("x-header1").value());
Assertions.assertEquals("value1", ctx.header("X-HEADER1").value());
Assertions.assertEquals("value1", ctx.header("X-hEaDeR1").value());
return "OK";
})).ready(http -> http.header("x-header1", "value1").get("/", rsp -> {
Assertions.assertEquals(200, rsp.code());
}));
}
}