tetsunosukeのnotebook

tetsunosukeのメモです

Locationヘッダで返すのは絶対URI

10.11  Location

   The Location response-header field defines the exact location of the
   resource that was identified by the Request-URI. For 3xx responses,
   the location must indicate the server's preferred URL for automatic
   redirection to the resource. Only one absolute URL is allowed.

       Location       = "Location" ":" absoluteURI
14.30 Location

   The Location response-header field is used to redirect the recipient
   to a location other than the Request-URI for completion of the
   request or identification of a new resource. For 201 (Created)
   responses, the Location is that of the new resource which was created
   by the request. For 3xx responses, the location SHOULD indicate the
   server's preferred URI for automatic redirection to the resource. The
   field value consists of a single absolute URI.

       Location       = "Location" ":" absoluteURI

しょっちゅうみかけるんですよ。
Locationヘッダーで

Location : ./test.html

とすればいいですよ、という記述。そうじゃないよ。と。

※ちなみに自分的にはいつもコロンの前後のスペースがどうだったか忘れる。