[jboss-jira] [JBoss JIRA] Created: (JBAS-5051) HTTP/1.1 400 No Host matches server name localhost

Scott M Stark (JIRA) jira-events at lists.jboss.org
Wed Dec 5 15:39:51 EST 2007


HTTP/1.1 400 No Host matches server name localhost
--------------------------------------------------

                 Key: JBAS-5051
                 URL: http://jira.jboss.com/jira/browse/JBAS-5051
             Project: JBoss Application Server
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: Test Suite, Web (Tomcat) service
         Environment: org.jboss.test.security.test.WebConstraintsUnitTestCase.testGetAccess
            Reporter: Scott M Stark
         Assigned To: Remy Maucherat
             Fix For:  JBossAS-5.0.0.Beta3


Why would an http-client request fail with this 400 error when wget and firefox work fine?

http-client output from WebConstraintsUnitTestCase.testGetAccess test:
217 [main] DEBUG org.jboss.test.util.web.HttpUtils  - Connecting to: http://getUser:getUserPass@localhost:8080/web-constraints/restricted/get-only
221 [main] DEBUG org.jboss.test.util.web.HttpUtils  - RequestURI: http://localhost:8080/web-constraints/restricted/get-only
240 [main] DEBUG org.apache.commons.httpclient.HttpConnection  - Open connection to localhost:8080
244 [main] DEBUG httpclient.wire.header  - >> "GET /web-constraints/restricted/get-only HTTP/1.1[\r][\n]"
244 [main] DEBUG org.apache.commons.httpclient.HttpMethodBase  - Adding Host request header
259 [main] DEBUG httpclient.wire.header  - >> "User-Agent: Jakarta Commons-HttpClient/3.0.1[\r][\n]"
260 [main] DEBUG httpclient.wire.header  - >> "Host: localhost:8080[\r][\n]"
261 [main] DEBUG httpclient.wire.header  - >> "[\r][\n]"
264 [main] DEBUG httpclient.wire.header  - << "HTTP/1.1 400 No Host matches server name localhost[\r][\n]"
266 [main] DEBUG httpclient.wire.header  - << "Server: Apache-Coyote/1.1[\r][\n]"
266 [main] DEBUG httpclient.wire.header  - << "Transfer-Encoding: chunked[\r][\n]"
266 [main] DEBUG httpclient.wire.header  - << "Date: Wed, 05 Dec 2007 20:21:51 GMT[\r][\n]"
266 [main] DEBUG httpclient.wire.header  - << "Connection: close[\r][\n]"
272 [main] DEBUG org.jboss.test.util.web.HttpUtils  - responseCode=400, response=No Host matches server name localhost
272 [main] WARN org.apache.commons.httpclient.HttpMethodBase  - Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.
272 [main] DEBUG org.apache.commons.httpclient.HttpMethodBase  - Buffering response body
272 [main] DEBUG httpclient.wire.content  - << "0"
272 [main] DEBUG httpclient.wire.content  - << "[\r]"
272 [main] DEBUG httpclient.wire.content  - << "[\n]"
272 [main] DEBUG httpclient.wire.content  - << "[\r]"
272 [main] DEBUG httpclient.wire.content  - << "[\n]"
273 [main] DEBUG org.apache.commons.httpclient.HttpMethodBase  - Should close connection in response to directive: close
273 [main] DEBUG org.apache.commons.httpclient.HttpConnection  - Releasing connection back to connection manager.
273 [main] DEBUG org.apache.commons.httpclient.HttpMethodBase  - Default charset used: ISO-8859-1
273 [main] DEBUG org.jboss.test.util.web.HttpUtils  - 

wget output:
[starksm at succubus testsuite]$ wget -S --http-user=getUser --http-passwd=getUserPass http://localhost:8080/web-constraints/restricted/get-only
--12:26:36--  http://localhost:8080/web-constraints/restricted/get-only
           => `get-only'
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:8080... connected.
HTTP request sent, awaiting response...
  HTTP/1.1 200 OK
  Server: Apache-Coyote/1.1
  Pragma: No-cache
  Cache-Control: no-cache
  Expires: Wed, 31 Dec 1969 16:00:00 PST
  X-Powered-By: Servlet 2.5; JBoss-5.0.0.Alpha (build: CVSTag=HEAD date=200606261952)/Tomcat-6.0
  Content-Length: 79
  Date: Wed, 05 Dec 2007 20:26:36 GMT
  Connection: keep-alive
Length: 79

100%[===================================>] 79            --.--K/s

12:26:36 (6.28 MB/s) - `get-only' saved [79/79]


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list