リダイレクト時の相対パス補完失敗
リダイレクトに失敗する事例を見つけました。
https://imslp.org/
この URL にアクセスするとサーバ側からステータスとして 301 Moved Permanently が返されます。
このときレスポンスヘッダに含まれる転送先は
Location: //imslp.org/wiki/Main_Page
です。
相対パスが // から始まるとき (Scheme 部分が省略された形式) の補完にバグあるようです。
ログを見ると補完結果が https//imslp.org/wiki/Main_Page となってしまっています。
─────────────────────────────────
16:12:44.650 [0:1412]接続:127.0.0.1
16:12:44.650 [0]受信:POST /:poke HTTP/1.1 Host: localhost:60080 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:99.0) Gecko/20100101 Firefox/99.0 Accept: */* Accept-Language: ja,en-US;q=0.7,en;q=0.3 Accept-Encoding: gzip, deflate, br Content-Type: application/x-www-form-urlencoded; charset=UTF-8 If-Modified-Since: Thu, 01 Jun 1970 00:00:00 GMT X-Requested-With: XMLHttpRequest Content-Length: 21 Origin: http://localhost:60080 DNT: 1 Connection: keep-alive Referer: http://localhost:60
16:12:44.650 [0]URL0:https://imslp.org/
16:12:45.670 [1848]外部接続(SSL):imslp.org=2001:260:306:c::a772:ae85:443
16:12:45.670 [1848]外部送信:GET / HTTP/1.1 Host: imslp.org User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:99.0) Gecko/20100101 Firefox/99.0 Accept-Encoding: gzip,deflate Accept-Language: ja,en Accept: */*
16:12:45.860 [1848]外部受信726bytes:HTTP/1.1 301 Moved Permanently Server: nginx/1.10.3 (Ubuntu) Date: Fri, 22 Apr 2022 07:12:45 GMT Content-Type: text/html; charset=utf-8 Transfer-Encoding: chunked Connection: keep-alive Cache-Control: private, no-cache, must-revalidate, max-age=0 Location: //imslp.org/wiki/Main_Page Expires: Thu, 01 Jan 1970 00:00:00 GMT Vary: Accept-Encoding, Cookie Set-Cookie: imslp_wikiLanguageSelectorLanguage=ja; expires=Sat, 22-Apr-2023 07:12:45 GMT; Max-Age=31536000;
16:12:45.860 L3541:伸長バッファ確保1095bytes
16:12:45.860 L3555:圧縮コンテンツ伸長エラー1(https://imslp.org/)
16:12:45.860 不明なプロトコル:https//imslp.org/wiki/Main_Page
16:12:45.860 [0]URL0:E,不明なプロトコル,https//imslp.org/wiki/Main_Page
16:12:45.860 [0]送信:HTTP/1.0 200 OK Content-Type: application/json; charset=utf-8 Content-Length: 99 Pragma: no-cache Cache-Control: no-cache Connection: close
16:12:45.860 [0]切断
  • 齊藤
  • 2022/04/22 (Fri) 16:37:06
Re: リダイレクト時の相対パス補完失敗
齊藤さん

ご指摘ありがとうございます!
詳しい情報をいただいたおかげで修正箇所の特定が簡単でした。
単純な文字列操作のバグでした。

問題を修正したバージョン3.2を新しく公開しました。
https://ztmsdf.appspot.com/jcbookmark/

バージョンアップをよろしくお願いいたします。
  • ZTMS(管理人)
  • 2022/04/23 (Sat) 16:16:54
Re: リダイレクト時の相対パス補完失敗
素早い対応ですね。 ありがとうございます。
新しいバージョンで問題が解消できていることを確認できました。
  • 齊藤
  • 2022/04/23 (Sat) 19:23:53

返信フォーム






プレビュー (投稿前に内容を確認)