Project

General

Profile

Backport(バックポート) #2776

Web API の認証エラー時のHTTPレスポンスヘッダーが200となっている

Added by Maki Takahashi almost 12 years ago. Updated almost 12 years ago.

Status:
Fixed(完了)
Priority:
Normal(通常)
Target version:
Start date:
2011-03-26
Due date:
% Done:

100%


Description

現象

認証が通っていない環境から以下のようなコマンドを叩くと
本来はレスポンスで 401 もしくは 403 のHTTPヘッダが一行目に返ってくるはずが
200 のレスポンスが返ってきている

telnet sns.example.com 80

GET /api.php/feeds/member/1 HTTP/1.1
Host: sns.example.com
HTTP/1.1 200 OK

=== (省略) ===

401 Unauthorized

原因

認証失敗時のHTTPヘッダの一行目の記述がない

修正内容

lib/filter/opAPISecurityFilter.class.php の 51行目にてステータスコード等を出力しているが
ヘッダー出力ではないため、上記の記述を他のヘッダー出力の前に「ヘッダー」出力する


Related issues

Related to OpenPNE 3 - Bug(バグ) #1977: Web API の認証エラー時のHTTPレスポンスヘッダーが200となっている Fixed(完了) 2011-03-26

Associated revisions

Revision c89d90b7 (diff)
Added by Maki Takahashi almost 12 years ago

(fixes #2776, BP from #1977) added send status code before send other httpHeaders in opAPISecurityFilter
(cherry picked from commit c50557e901d77633db2b1812b2c7041a3ca045c5)

Revision 16003089 (diff)
Added by Maki Takahashi almost 12 years ago

(fixes #2776, BP from #1977) use sfWebResponse::sendHttpHeaders() instead of header() and undo remove response body
(cherry picked from commit 6a717dbea7857a13095033077f68f6416d180ec3)

History

#1 Updated by Maki Takahashi almost 12 years ago

  • Description updated (diff)

#2 Updated by Maki Takahashi almost 12 years ago

  • Description updated (diff)

#3 Updated by Maki Takahashi almost 12 years ago

  • Status changed from New(新規) to Pending Review(レビュー待ち)
  • % Done changed from 0 to 50

更新履歴 c89d90b754da30e0799e3cfbbaf47bd3ec34b1bf で適用されました。

#4 Updated by Kousuke Ebihara almost 12 years ago

  • Status changed from Pending Review(レビュー待ち) to Rejected(差し戻し)

親チケット #1977 に従い、こちらも差し戻します。

#5 Updated by Maki Takahashi almost 12 years ago

  • Status changed from Rejected(差し戻し) to Pending Review(レビュー待ち)

更新履歴 1600308947f6b21ce4fdd1a2f514c106ed97cbf7 で適用されました。

#6 Updated by Kousuke Ebihara almost 12 years ago

  • Status changed from Pending Review(レビュー待ち) to Pending Testing(テスト待ち)
  • % Done changed from 50 to 70

#7 Updated by Yuma Sakata almost 12 years ago

  • Status changed from Pending Testing(テスト待ち) to Fixed(完了)
  • % Done changed from 70 to 100

テストOKです。

Also available in: Atom PDF