/
231.txt
104 lines (77 loc) · 5.7 KB
/
231.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
[14] [DFN[[CODE(HTTP)[[[308]]]]]] ([DFN[[[Permanent Redirect]]]])
は、永続的な[[リダイレクト]]を表す[[状態符号]]です。
[[リダイレクト]]の前後で同じ[[要求メソッド]]を使わなければならないことも表しています。
;; [15] [CODE(HTTP)@en[[[POST]]]] を[[リダイレクト]]された時
[CODE(HTTP)@en[[[GET]]]] にしても良い [CODE(HTTP)[[[301]]]] とは異なります。
* 仕様書
[REFS[
- [5] [CITE@en[RFC 7538 - The Hypertext Transfer Protocol Status Code 308 (Permanent Redirect)]] ([TIME[2015-04-07 07:04:41 +09:00]] 版) <https://tools.ietf.org/html/rfc7538>
-- [25] 旧 [CITE@en[RFC 7238 - The Hypertext Transfer Protocol Status Code 308 (Permanent Redirect)]] ([TIME[2014-06-07 01:57:48 +09:00]] 版) <https://tools.ietf.org/html/rfc7238>
]REFS]
* 意味
[7] [CODE(HTTP)[[[308]]]] は、[[対象資源]]に新しい永続的 [[URL]]
が割り当てられ、以後この[[資源]]を参照する時に指定された [[URL]]
のいずれかを使う[RUBYB[べき]@en[ought to]]であることを示します [SRC[>>5]]。
[28] [CODE(HTTP)[[[308]]]] は、[[リダイレクト状態]]の1つです。
;; 従って [[Webブラウザー]]は [CODE(HTTP)[[[308]]]]
[[応答]]を[[リダイレクト]]として扱います。
* 構文
[9] [[サーバー]]は、新しい永続的 [[URL]] を含んだ [CODE(HTTP)@en[[[Location:]]]]
[[ヘッダー]]を[[生成]]する[['''べきです''']] [SRC[>>5]]。
;; [16] なぜか必須にはなっていません。
[11] [[応答]]の [[payload]] は普通新しい [[URL]] (群)
への[[ハイパーリンク]]つきの短い[[ハイパーテキスト]]のメモを含みます [SRC[>>5]]。
* 処理
[10] [[利用者エージェント]]は [CODE(HTTP)@en[[[Location:]]]]
[[ヘッダー]]の値を自動的に[[リダイレクト]]に使って構いません [SRC[>>5]]。
[13] [CODE(HTTP)[[[301]]]] [[応答]]とは違って、[[要求メソッド]]は[[リダイレクト]]前後で同じでなければいけません。
[8] [[リンク]]を編集する能力のある[[クライアント]]は、
できるだけ[[実効要求URL]]への[[リンク]]を指定された新しい参照のうちの1つ以上に自動的に修正するべきです
[SRC[>>5]]。
[12] [CODE(HTTP)[[[308]]]] [[応答]]は、[[キャッシュ可能]]です [SRC[>>5]]。
* 歴史
** [CODE(HTTP)[308 Resume Incomplete]]
[22] [CODE(HTTP)[[[308]]]] ([DFN[[[Resume Incomplete]]]]) は [[Google Gears]]
他 [[Google]] を中心にいくつかの実装が存在していました。
[REFS[
- [2] [CITE[ResumableHttpRequestsProposal - gears - A proposal for supporting resumable POST/PUT HTTP requests in HTTP/1.0. - Improving Your Web Browser - Google Project Hosting]]
( ([TIME[2012-02-19 13:11:48 +09:00]] 版))
<http://code.google.com/p/gears/wiki/ResumableHttpRequestsProposal>
- [17] [CITE[rfc - What's the deal with HTTP status code 308? - Stack Overflow]] ([TIME[2014-09-04 14:19:02 +09:00]] 版) <http://stackoverflow.com/questions/14144664/whats-the-deal-with-http-status-code-308>
- [18] [CITE[php - Google Document List API 308 Resume Incomplete - Stack Overflow]] ([TIME[2014-09-04 14:20:32 +09:00]] 版) <http://stackoverflow.com/questions/12429447/google-document-list-api-308-resume-incomplete>
- [19] [CITE@en[HTTP 308 Resume Incomplete missing in Zend\Http\Response · Issue #2454 · zendframework/zf2]] ([TIME[2014-09-04 14:23:10 +09:00]] 版) <https://github.com/zendframework/zf2/issues/2454>
- [20] [CITE[もうひとつのHTTP Status 308 - Null and void]] ([TIME[2014-08-30 06:20:37 +09:00]] 版) <http://d.hatena.ne.jp/chi-bd/20140223/1393127861>
- [21] [CITE@ja[YouTube API v2.0 – Resumable Uploads - YouTube — Google Developers]] ([TIME[2014-07-14 19:58:12 +09:00]] 版) <https://developers.google.com/youtube/2.0/developers_guide_protocol_resumable_uploads>
- [23] [CITE@ja[Loading Data with a POST Request - Google BigQuery — Google Cloud Platform]] ([TIME[2014-12-18 02:33:03 +09:00]] 版) <https://cloud.google.com/bigquery/loading-data-post-request#resume-upload>
]REFS]
[FIG(quote)[
[FIGCAPTION[
[24] [[Google BigQuery]] での例 [SRC[>>23]]
]FIGCAPTION]
>
[PRE(HTTP code)[
HTTP/1.1 308 Resume Incomplete
Content-Length: 0
Range: 0-42
]PRE]
]FIG]
** [CODE(HTTP)[308 Permanent Redirect]]
[6] [CODE(HTTP)[[[308]]]] は [[RFC 7238]] で定義されました。 [[Google]]
の [CODE(HTTP)[[[308]]]] とは無関係で、互換性はありません。
[REFS[
- [1] [CITE@en[draft-reschke-http-status-308-01 - The Hypertext Transfer Protocol (HTTP) Status Code 308 (Permanent Redirect)]]
( ([TIME[2012-01-05 09:15:23 +09:00]] 版))
<http://tools.ietf.org/html/draft-reschke-http-status-308-01>
- [3] [CITE@en[draft-reschke-http-status-308-07 - The Hypertext Transfer Protocol (HTTP) Status Code 308 (Permanent Redirect)]]
( ([TIME[2012-03-27 02:32:30 +09:00]] 版))
<http://tools.ietf.org/html/draft-reschke-http-status-308-07>
- [4] [CITE@en[Pushing the Web Forward with HTTP/308 - EricLaw's IEInternals - Site Home - MSDN Blogs]]
( ([TIME[2012-04-23 08:17:40 +09:00]] 版))
<http://blogs.msdn.com/b/ieinternals/archive/2012/03/29/http-308-permanent-redirect-pushing-the-web-forward-by-breaking-unwanted-forward-compatibility.aspx>
]REFS]
[27] [[RFC 7238]] の出版から1年も待たずに [DFN[[[RFC 7538]]]] [SRC[>>25]]
が新たに出版されました。しかし実質的に変更はなく [SRC[>>26]]、
深刻な問題があっても滅多に改訂版を出さない [[IETF]] にしては珍しいことです。
[REFS[
- [26] [CITE[wdiff rfc7238.txt rfc7538.txt]] ([TIME[2015-04-08 18:24:25 +09:00]] 版) <https://tools.ietf.org/rfcdiff?difftype=--hwdiff&url1=rfc7238&url2=rfc7538>
]REFS]