Skip to content

Commit

Permalink
Update accept header to */*
Browse files Browse the repository at this point in the history
  • Loading branch information
djelinski committed Jan 24, 2022
1 parent 86d6d6d commit b9683b3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,7 @@ private static Set<String> schemesListToSet(String list) {
}

static final String httpVersion = "HTTP/1.1";
static final String acceptString =
"text/html, image/gif, image/jpeg, */*; q=0.2";
static final String acceptString = "*/*";

// the following http request headers should NOT have their values
// returned for security reasons.
Expand Down
12 changes: 6 additions & 6 deletions test/jdk/sun/net/www/B8185898.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,32 +143,32 @@ static void testMessageHeaderMethods() throws IOException {
// {{inputString1, expectedToString1, expectedPrint1}, {...}}
String[][] strings = {
{"HTTP/1.1 200 OK\r\n"
+ "Accept: text/html, image/gif, image/jpeg, */*; q=0.2\r\n"
+ "Accept: */*\r\n"
+ "Connection: keep-alive\r\n"
+ "Host: 127.0.0.1:12345\r\n"
+ "User-agent: Java/12\r\n\r\nfoooo",
"pairs: {null: HTTP/1.1 200 OK}"
+ "{Accept: text/html, image/gif, image/jpeg, */*; q=0.2}"
+ "{Accept: */*}"
+ "{Connection: keep-alive}"
+ "{Host: 127.0.0.1:12345}"
+ "{User-agent: Java/12}",
"Accept: text/html, image/gif, image/jpeg, */*; q=0.2\r\n"
"Accept: */*\r\n"
+ "Connection: keep-alive\r\n"
+ "Host: 127.0.0.1:12345\r\n"
+ "User-agent: Java/12\r\n\r\n"},
{"HTTP/1.1 200 OK\r\n"
+ "Accept: text/html, image/gif, image/jpeg, */*; q=0.2\r\n"
+ "Accept: */*\r\n"
+ "Connection: keep-alive\r\n"
+ "Host: 127.0.0.1:12345\r\n"
+ "User-agent: Java/12\r\n"
+ "X-Header:\r\n\r\n",
"pairs: {null: HTTP/1.1 200 OK}"
+ "{Accept: text/html, image/gif, image/jpeg, */*; q=0.2}"
+ "{Accept: */*}"
+ "{Connection: keep-alive}"
+ "{Host: 127.0.0.1:12345}"
+ "{User-agent: Java/12}"
+ "{X-Header: }",
"Accept: text/html, image/gif, image/jpeg, */*; q=0.2\r\n"
"Accept: */*\r\n"
+ "Connection: keep-alive\r\n"
+ "Host: 127.0.0.1:12345\r\n"
+ "User-agent: Java/12\r\n"
Expand Down

0 comments on commit b9683b3

Please sign in to comment.