【问题标题】:equivalent HTTP queries get different responses等效的 HTTP 查询得到不同的响应
【发布时间】:2012-11-06 04:46:21
【问题描述】:

GET http://d9.c4.b1.a0.top.list.ru/ HTTP/1.0\r\nHost: d9.c4.b1.a0.top.list.ru\r\n\r\n

回复:

HTTP/1.0 400 Bad Request
Server: wz/1.5
Date: Sat, 17 Nov 2012 19:00:20 GMT
Cache-control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-Length: 0
Connection: close


GET / HTTP/1.0\r\nHost: d9.c4.b1.a0.top.list.ru\r\n\r\n

回复:

HTTP/1.0 302 Moved Temporarily
Server: wz/1.5
Date: Sat, 17 Nov 2012 19:06:27 GMT
Location: http://top.mail.ru/
Cache-control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-Length: 0
Connection: close

这些查询有什么区别?

附:使用telnet进行查询。

【问题讨论】:

    标签: http telnet http-method http-1.0


    【解决方案1】:

    来自HTTP 1.0 specification on the Request-URI:

    absoluteURI 形式仅在向代理发出请求时才允许使用。

    所以看起来你发送这个请求的服务器不是代理,而可能是指定的服务器本身。

    在发送到指定服务器的请求中使用请求行中的绝对URI只有valid in HTTP 1.1:

    允许在未来的所有请求中转换到 absoluteURIs HTTP 版本,所有 HTTP/1.1 服务器必须接受 absoluteURI 请求中的表单,即使 HTTP/1.1 客户端只会生成 他们在对代理的请求中。

    【讨论】:

      猜你喜欢
      • 2020-11-23
      • 2014-06-22
      • 1970-01-01
      • 1970-01-01
      • 2022-10-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多