Project

General

Profile

Actions

Bug #7650

closed

net/http always added port number in host header.

Added by hsbt (Hiroshi SHIBATA) over 11 years ago. Updated over 11 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 2.0.0dev (2013-01-02 trunk 38676) [x86_64-darwin12.2.1]
Backport:
[ruby-dev:46829]

Description

#6482 の変更から、URI インスタンスを Net::HTTP のリクエストに渡した時に host ヘッダにホスト名とポート番号がつくようになりましたが、いくつかのサービスはポート番号付きのリクエストは動かないようです。(例: amazon の ecs api)

w3c に従うと、ポート番号を付けても動くべきと思いますが、今現在 amazon のような大きなサービスでも動かない状況なので、添付しているパッチのように 2.0 ではポート番号は付けないようして頂けないでしょうか。

参考URL:


Files

generic_request.patch (461 Bytes) generic_request.patch hsbt (Hiroshi SHIBATA), 01/03/2013 05:01 PM
generic_request2.patch (529 Bytes) generic_request2.patch hsbt (Hiroshi SHIBATA), 01/05/2013 07:44 PM

Updated by mame (Yusuke Endoh) over 11 years ago

  • Status changed from Open to Assigned
  • Priority changed from Normal to 6

Updated by hsbt (Hiroshi SHIBATA) over 11 years ago

tDiary の issue にも記載していますが、nahi さんの httpclient でもデフォルトのポート番号は付けないように回避しているようです。

https://github.com/nahi/httpclient/blob/master/lib/httpclient/http.rb#L395

Updated by mame (Yusuke Endoh) over 11 years ago

  • Priority changed from 6 to 7

Updated by hsbt (Hiroshi SHIBATA) over 11 years ago

httpclient にあわせて、全てのポート番号を無視するのではなく uri scheme のデフォルトポートの場合は付けないようにパッチを修正しました。この内容で検討をお願いします。

Actions #5

Updated by naruse (Yui NARUSE) over 11 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r38707.
Hiroshi, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • lib/net/http/generic_request.rb:
    Amazon ECA API and GTE/1.3 disallow requests whose host has port
    number if its port number equlas to default port number of the
    scheme. [Bug #7650]
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0