-
Notifications
You must be signed in to change notification settings - Fork 4
/
39.txt
748 lines (550 loc) · 37.1 KB
/
39.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
[412] [DFN[[[authority]]]] は、[[URL]] のうち、 [[scheme]] と [CODE(URI)[[[:]]]]
の直後の [CODE(URI)@en[[[//]]]] とその後最初の
[CODE(URI)[[[/]]]], [CODE(URI)@en[[[?]]]], [CODE(URI)[[['''#''']]]] または末尾の間にある部分です。
[413] 多くの場合 [[authority]] は[[ドメイン名]]や[[ホスト名]]や [[IPアドレス]] ([[host]]) と、
省略可能な[[利用者名]]や[[合言葉]] ([[userinfo]]) や[[ポート番号]]
([[port]]) を指定することになっています。
[FIG(railroad)[
= ?
== [[ユーザー名]]
== ?
=== [CODE[[[:]]]]
=== [[パスワード]]
== [CODE[[[@]]]]
= [[ホスト]]
= ?
== [CODE[[[:]]]]
== [[ポート]]
]FIG]
* authority の内容
** そもそも使わない
[416] [CODE(URI)@en[[[mailto:]]]], [CODE(URI)@en[[[about:]]]], [CODE(URI)@en[[[tel:]]]]
などではそもそも [[authority]] 部分が存在しません。
** ホスト名
[415] [CODE(URI)@en[[[http:]]]] など多くの [[URL]] では、 [[ホスト名]]を指定します。
直後に[[ポート番号]]、直前に [[userinfo]] を指定することも可能なことが多いです。
;; [20] [[userinfo]] を認めないもの、[[利用者名]]は認めても[[合言葉]]は認めないものもあります。
[23] [[URL scheme]] にもよりますが、一般に[[ホスト名]]が何を表しているのか正確には定義されていません。
ほとんどの場合、この[[ホスト名]]は[[インターネット]]の [[DNS]] によって[[名前解決]]して得られる
[[IPアドレス]]によって表現される[[ホスト]]を意味しています。しかし[[名前解決]]の方法や結果はシステムやアプリケーションに依存しており、
[[イントラネット]]内の独自の[[ドメイン名]]や、 [[DNS]] 以外の方法で[[解決]]される[[名前]]、
[[Tor]] の [CODE[[[.onion]]]] [[ドメイン名]]などが記述されることも少なくありません。
;; [[名前解決]]を参照。
[24] 末尾に [[root domain]] を表す [CODE[[[.]]]] を付けた[[ドメイン名]]が用いられることも稀にあります。
しかし [[URL]] としての[[正規化]]の対象にはなっていませんから、 [CODE[[[.]]]]
が付かない[[ドメイン名]]とは異なるものとして扱われるのが普通です。
[EG[
[25] 例えば [CODE[http://www.example.com/]] と [CODE[http://www.example.com./]]
の [[URLの起源]]は異なるとみなされますから、 [[JavaScript]] で両者のページに直接アクセスすることはできません。
]EG]
** ホスト名以外のネットワーク上のオブジェクトの識別子
[FIG(short list)[
- [CODE(URI)@en[[[ci:]]]]
- [CODE(URI)@en[[[dvb:]]]]
]FIG]
*** resource-less JID
[9] [CODE(URI)@en[[[httpx:]]]] では [[resource-less JID]] を指定します。
*** 作業グループ名
[418] [CODE(URI)@en[[[smb:]]]] では[[ホスト名]]、[[SMB]] [[鯖名]]、[[SMB]]
[[作業グループ名]]を指定できます。
*** IRC ネットワーク名
[417] [CODE(URI)@en[[[irc:]]]] では[[ホスト名]]の他に [[IRC]]
の[[ネットワーク名]]も指定できます。
** URL のようなもの
[14] [CODE(URI)@en[[[pack:]]]] [[URI scheme]] では、 [[authority]] 部に[[パッケージURI]]
を適当に変換したものを使います。
** ファイル名
[408] [CODE(URI)@en[[[res:]]]] [[URL]] では [[Windows]] の[[ファイル名]]を [[authority]]
として使います。
** パッケージ名など内部構造の名前
[403] [CODE(URI)@en[[[chrome:]]]] ([[Gecko]])、
[CODE(URI)@en[[[chrome-extension:]]]]、[CODE(URI)@en[[[safari-extension:]]]]
では[[拡張機能]]のパッケージ名を [CODE(ABNF)@en[[[authority]]]]
部分に使っています。
[401] [CODE(URI)@en[[[hcp:]]]] や [CODE(URI)@en[[[ms-help:]]]]
では内部的な[[識別子]]を指定するために使います。
[414] [CODE(URI)@en[[[widget:]]]] [[URL]] では [[UUID]] とされています。
[409] [CODE(URI)@en[[[wysisyg:]]]]
[450] [CODE(URI)@en[[[android-app:]]]] や
[CODE(URI)@en[[[android.resource:]]]] はパッケージ名 ([[逆ドメイン名]]) を使っています。
[451] [[逆ドメイン名]]らしきもの
[FIG(short list)[
- [CODE(URI)@en[[[appigotodo:]]]]
- [CODE(URI)@en[[[bundleclass:]]]]
]FIG]
[10] [CODE(URI)@en[[[gs:]]]] では [[bucket]] 名とされています。
[11] [CODE(URI)@en[[[widget:]]]] では [[UUID]] を採用しています。
** LDAP
[419] [CODE(URI)@en[[[ldap:]]]] の [[Microsoft]] の実装では [[dn]] など [[LDAP]]
における名前と値の組の並びを指定できるようです。
;; [420] [[IETF]] の定義では [[path]] の部分に含めることになっているものです。
** 利用者識別子
[453] 何らかの[[利用者]]を識別するもの ([[ユーザー名]]、[[アカウント]]のIDなど) を使うものもあります。
[FIG(short list)[
- [CODE(URI)@en[[[tweetbot:]]]]
- [CODE(URI)@en[[[wpp:]]]]
]FIG]
** x-callback-url
[452] [[x-callback-url]] 参照。
[12] [[ホスト]]による指定と [[x-callback-url]] の両方に対応している [[URL scheme]]
もあります。
** 無制限
[FIG(short list)[
- [CODE(URI)@en[[[ni:]]]]
]FIG]
** path と変わらない使い方をされるもの
[423] [[URL]] の構造的意味を理解せずに設計された [[URL scheme]] では、しばしば [[authority]]
は単に [[scheme]] の後に [CODE[://]] を続けたためだけに形式的に存在するのみで、
実質的には [[path]] のような使われ方をされています。階層型構造の位置を表していたり、
アプリケーション内の識別子であったり、アプリケーションの動作の指令であったりします。
[FIG(short list)[
- [CODE(URI)@en[[[amb:]]]]
- [CODE(URI)@en[[[bookpedia:]]]]
- [CODE(URI)@en[[[byword:]]]]
- [CODE(URI)@en[[[callrec:]]]]
- [CODE(URI)@en[[[cartographer:]]]]
- [CODE(URI)@en[[[cdpedia:]]]]
- [CODE(URI)@en[[[cheapcalls:]]]]
- [CODE(URI)@en[[[cloudrop:]]]]
- [CODE(URI)@en[[[cobitools:]]]]
- [CODE(URI)@en[[[dailymotion:]]]]
- [CODE(URI)@en[[[define:]]]]
- [CODE(URI)@en[[[duoxx:]]]]
- [CODE(URI)@en[[[dvdpedia:]]]]
- [CODE(URI)@en[[[editorial]]]]
- [CODE(URI)@en[[[eureka:]]]]
- [CODE(URI)@en[[[fb:]]]]
- [CODE(URI)@en[[[gamepedia:]]]]
- [CODE(URI)@en[[[gcbuddy:]]]]
- [CODE(URI)@en[[[geopherlite:]]]]
- [CODE(URI)@en[[[imagedata:]]]]
- [CODE(URI)@en[[[izorn:]]]]
- [CODE(URI)@en[[[kippster:]]]]
- [CODE(URI)@en[[[launchpro-dropbox:]]]]
- [CODE(URI)@en[[[localch:]]]]
- [424] [CODE(URI)@en[[[mail:]]]]
- [CODE(URI)@en[[[mypraypal:]]]]
- [CODE(URI)@en[[[navigon:]]]]
- [CODE(URI)@en[[[pic2shop:]]]]
- [CODE(URI)@en[[[purecalc:]]]]
- [CODE(URI)@en[[[radarscope:]]]]
- [CODE(URI)@en[[[roundtuit:]]]]
- [CODE(URI)@en[[[x-seesmic:]]]]
- [CODE(URI)@en[[[simplenote:]]]]
- [CODE(URI)@en[[[surfboard:]]]]
- [CODE(URI)@en[[[threadnote:]]]]
- [CODE(URI)@en[[[tikisurf:]]]]
- [CODE(URI)@en[[[timelog:]]]]
- [CODE(URI)@en[[[twitter:]]]]
- [425] [CODE(URI)@en[[[ugomemo:]]]]
- [CODE(URI)@en[[[unfragment:]]]]
- [CODE(URI)@en[[[yummy:]]]]
- [CODE(URI)@en[[[zentap:]]]]
- [CODE(URI)@en[[[zentappro:]]]]
]FIG]
** 常に空文字列
** その他独自のもの
* userinfo
[454] [[userinfo]] の項を参照してください。
* ホスト名指定
[33] [[FQDN]] の他、[[内部名]]の使用も特に禁止されていません。
[34] [[FQDN]] であることを明示する末尾の [CODE[[[.]]]] ([[末尾の点]] = [[根ドメイン]]を表すもの)
の利用も禁止されていません。一般に [CODE[[[.]]]] がある指定はない指定とは別とみなされ、
[[正規化]]の対象にはなりません。
[35] 末尾 [CODE[[[.]]]] 付きの指定は普通は使いません。
[36] しかし <http://to./> のように [[TLD]] にアクセスしたい時は[[内部名]]と誤認されることを防ぐため [CODE[[[.]]]]
を明示します。
[32] [[名前解決]]も参照。
* IP アドレス指定
[22] [[IPアドレス]]による指定は好ましくない [SRC[>>21]] とされることもあります。
[REFS[
- [21] [CITE@en[RFC 7472 - Internet Printing Protocol (IPP) over HTTPS Transport Binding and the 'ipps' URI Scheme]] ([TIME[2015-03-04 12:23:14 +09:00]] 版) <https://tools.ietf.org/html/rfc7472#section-4.2>
]REFS]
[31] [[予約済みIPアドレス]]の使用も特に禁止されていません。
* IPv6 アドレス
[428] [[IPv6アドレス]]は [CODE[[['''[''']]]] と [CODE[[[''']''']]]] で括って指定することができます。
;; [429] [[URL]] ではこれらの2文字は使えないことになっていましたが、 [[IPv6アドレス]]の表記のために(だけ)使えるように変更されました。
** ゾーン識別子
[430] [[IPv6 Scoped Address]] は [[IPv6アドレス]]の後に [CODE[[[%]]]] で区切って[[ゾーン識別子]]を指定したもので、
解釈する環境における[[ネットワークインターフェイス]]とそれを使ってアクセスするべき [[IPv6アドレス]]を表したものとなっています。
[[RFC 6874]] はこれを [[authority]] として使う方法を定義しています。
[REFS[
- [431] [CITE@en[RFC 6874 - Representing IPv6 Zone Identifiers in Address Literals and Uniform Resource Identifiers]] ([TIME[2013-06-28 00:01:53 +09:00]] 版) <http://tools.ietf.org/html/rfc6874>
]REFS]
[433] 区切り文字の [CODE[[[%]]]] は、[[パーセント符号化]]して [CODE[[[%25]]]] とします [SRC[>>431]]。
[432] [[ゾーン識別子]]は、[[非予約文字]]はそのままでも構いませんが、それ以外は[[パーセント符号化]]します [SRC[>>431]]。
このとき使う[[文字コード]]は特に規定されていないようです。
;; [434] [[ゾーン識別子]]は[[非予約文字]]だけを使う[['''べきです''']]とされています [SRC[>>431]] が、
それは[[ゾーン識別子]]の仕様で規定するべきことで、 [[URL]] の [[RFC]] で要求するべきことではないでしょう...
;; [435] [[IPv4アドレス]]を使った [[URL]] でこの[[ゾーン識別子]]構文に相当するものはありません。
[436] この [[RFC]] が発行される前からこの構文を実装していた[[Webブラウザー]]もあり、また[[パーセント符号化]]されていない
[CODE[[[%]]]] を区切りにしている [[Webブラウザー]]もありました [SRC[>>431]]。 (特別に解釈しないでそのまま
[[OS]] に渡していただけかもしれませんが...) ただし生の [CODE[[[%]]]] を使った場合、その直後2文字が16進数として解釈できる場合、
2種類の解釈が可能となってしまいます。 [[Webブラウザー]]で[[利用者]]に [[URL]] を入力させる場合にあっては、
16進数として解釈できない場合は [CODE[[[%]]]] だけでも [CODE[[[%25]]]] の意味に扱うのがよかろうとされています [SRC[>>431]]。
[437] [[ゾーン識別子]]は特定の[[ホスト]]でしか意味をなしませんし、むしろ[[セキュリティー]]上の懸念もあります。
ですから明確な用途がある場合を除き、認めては[['''なりません''']]。例えば [[link-local address]] ([CODE[[[fe80::/10]]]])
がありますが、この [[RFC]] の執筆の時点で認められるべきなのはこれだけです。 [SRC[>>431]]
;; [438] 認められない時にどうするべきなのかは述べられていません。エラーとするべきなのか、
[[ゾーン識別子]]を削って続行するべきなのか。
[439] [[HTTP]] [[クライアント]]、[[プロキシ]]その他中間のものは外に出す [[URL]]
から[[ゾーン識別子]]を削除しなければ[['''なりません''']] [SRC[>>431]]。
;; [440] [[URL]] ではありませんが、 [CODE(HTTP)@en[[[Host:]]]] ヘッダーにも[[ゾーン識別子]]は含めるべきではなさそうです。
([CODE(HTTP)@en[[[Host:]]]] ([[RFC 723x]]) は [[URL]] ([[RFC 3986]]) の
[CODE(ABNF)@en[[[host]]]] を参照しています。)
[441] [[URL Standard]] にはこの構文は含まれていません。
[EG[
[442]
[PRE(URI example code)[
http://[fe80::a%25en1]
]PRE]
... [SRC[>>431]] は [CODE[fe80::a]] に[[ゾーン識別子]] [CODE[en1]] を使ってアクセスすることを表しています。
]EG]
* [CODE[IPvFuture]]
[443] [[RFC 3986]] は将来の拡張用として、 [DFN[[CODE[[[IPvFuture]]]]]] 構文を定義しています。
[[IPv6アドレス]]のように [CODE[[['''[''']]]] と [CODE[[[''']''']]]] で括りますが、先頭に
[CODE[v1.]] のような版識別子がつきます。
[444] 現時点でこの構文は使われていません。また [[IANA登録簿]]もなさそうです。
;; [445] [[URL Standard]] にはこの構文はありません。
[449] [[draft-fenner-literal-zone]] は[[ゾーン識別子]]のために
[PRE(URI example code)[
http://[v6.fe80::a+en1]
http://[v1.fe80::a_en1]
]PRE]
... のような構文を提案していましたが、十分な支持を得られなかったようで、数年のブランクの後 >>431
の通り [[IPv6アドレス]]の構文を拡張する形になっています。
[REFS[
- [446] [CITE@en[draft-fenner-literal-zone-00 - Formats for IPv6 Scope Zone Identifiers in Literal Address Formats]] (2004)
<http://tools.ietf.org/html/draft-fenner-literal-zone-00>
- [447] [CITE@en[draft-fenner-literal-zone-01 - Formats for IPv6 Scope Zone Identifiers in Literal Address Formats]] (2005) <http://tools.ietf.org/html/draft-fenner-literal-zone-01>
- [448] [CITE@en[draft-fenner-literal-zone-02 - Formats for IPv6 Scope Zone Identifiers in Literal Address Formats]] (2005)
<http://tools.ietf.org/html/draft-fenner-literal-zone-02>
]REFS]
* IP アドレスを表す非標準の authority
[15] <http://[208.77.188.166]/>
[[Firefox]] は [[IPv4]] [[番地]] 208.77.188.166
の[[鯖]]に接続します。 [CODE(HTTP)@en[[[Host]]:]] には 208.77.188.166
という値が使われます。
[[Opera]] は [[IPv4]] [[番地]] 208.77.188.166
の[[鯖]]に接続します。 [CODE(HTTP)@en[[[Host]]:]] にはおそらく [208.77.188.166]
という値が使われるので、 [[Apache]] からは [CODE(HTTP)[[[400]]]]
が返ってきます。
[[Safari]] は[[鯖]]を探し続けます。
[[WinIE 7]] ではエラーが表示されます。
[407] <http://[www.google.com]/>
;; いずれも [[Windows Vista]] での結果です。
[427] [[Windows 7]] 上の [[Chrome]] では、 >>15 も >>407 もリンク先が [CODE(URI)@en[[[about:blank]]]] になりました。
[[解決]]できない [[URL]] として扱われているのでしょうか。 [TIME[2013-10-14T13:03:57.500Z]]
* authority 以外のドメイン名
[16] [[authority]] 以外でも[[ドメイン名]]が [[URL]] に含まれることはよくあります。
[[Internet Archive]] の [CODE(URI)@en[[[http:]]]] [[URL]] のように[[鯖]]が自身の裁量で命名規則の一部として用いる場合もしばしばありますが、それを除けば、
[[URL scheme]] や[[プロトコル]]の定義により次に示す箇所で使われます。
[411] 次の [[URL scheme]] は、 [[path]] 部分に [[URL]] やそれに類する構造を埋め込むことができ、
[[authority]] に相当する構造がそれに含まれることがあります。
[FIG(short list)[
- [CODE(URI)@en[[[view-source:]]]]
- [CODE(URI)@en[[[jar:]]]]
- [CODE(URI)@en[[[service:]]]]
- [CODE(URI)@en[[[blob:]]]]
- [CODE(URI)@en[[[jdbc:]]]]
]FIG]
[410] 次の [[URL scheme]] は、[[メールアドレス]]に由来する構造を採用しており、
[[ドメイン名]]やそれに由来する構文を [[path]] や [[query]] の一部に含むことがあります。
[FIG(short list)[
- [CODE(URI)@en[[[mailto:]]]]
- [CODE(URI)@en[[[sip:]]]]
- [CODE(URI)@en[[[xmpp:]]]]
- [CODE(URI)@en[[[mid:]]]]
- [CODE(URI)@en[[[cid:]]]]
- [CODE(URI)@en[[[news:]]]]
- [CODE(URI)@en[[[nntp:]]]]
]FIG]
[455] 次の [[URL scheme]] はその他何らかの形で[[ドメイン名]]を [[path]] や [[query]]
に含むことがあります。
[FIG(short list)[
- [CODE(URI)@en[[[turn:]]]]
- [CODE(URI)@en[[[turns:]]]]
- [CODE(URI)@en[[[stun:]]]]
- [CODE(URI)@en[[[stuns:]]]]
]FIG]
[17] 次の [[XPointer scheme]] を使う場合は[[素片識別子]]に [[URL]]
が入れ子に含まれることがあります。
[FIG(short list)[
- [CODE(XPointerScheme)@en[[[xmlns()]]]]
]FIG]
* [CODE[[['''[''']]]] と [CODE[[[''']''']]]]
[459] 元々 [[URL]] では [CODE[[['''[''']]]] と [CODE[[[''']''']]]] は使えない
([[パーセント符号化]]しなければならない) ことになっていましたが、
[[RFC 2732]] で [[IPv6アドレス]]を表すために [[authority]] でのみ使えるように変更されました。
[460] [[RFC 3986]] では同じく [[authority]] で [CODE(ABNF)@en[[[IPvFuture]]]]
構文が導入されました。
[461] 現実には、それ以外の部分でもしばしばこれらの文字が使われています。
[462] 一部の [[URL scheme]] では構文の定義上、また [CODE(URI)@en[[[http:]]]]
[[URL]] などでは[[鯖]]側の判断により、 [[path]] や [[query]] などの一部または全部として他の
[[URL]] や [[authority]] に相当する部分が埋め込まれることがあります。
その場合元の [[URL]] や [[authority]] にこれらの文字が含まれていると、
[[path]] や [[query]] にもこれらの文字が ([[パーセント符号化]]なしで)
埋め込まれることがあります。
[463] [CODE(URI)@en[[[http:]]]] [[URL]] などでは[[鯖]]側の処理言語やライブラリー等により、
あるいは[[スクリプト]]など[[クライアント]]側の処理のライブラリー等により、
これらの文字が ([[パーセント符号化]]なしで) 特定の意味を持つ使われ方をしていることがあります。
例えば [[PHP]] では [[query]] 内の名前と値の組の名前の部分で、
[[配列]]を表すために使われます。また [[JSONP]] の [[query]] の [CODE(URI)@en[[[callback]]]]
[[引数]]で、数値または文字列によるオブジェクトのメンバーへのアクセスを表すためにこれらの文字が使われることがあります。
[464] [[素片識別子]]でも、これらの文字を含む [CODE[[[ID]]]] を表すため、あるいは[[スクリプト]]など[[クライアント]]側の処理で用いるため、
これらの文字が [[パーセント符号化]]なしで) 使われることがあります。
* 歴史
[FIG(quote)[
[FIGCATION[
[457] RFC 1738 (URL) 3.1. Common Internet Scheme Syntax
]FIGCAPTION]
> While the syntax for the rest of the URL may vary depending on the
particular scheme selected, URL schemes that involve the direct use
of an IP-based protocol to a specified host on the Internet use a
common syntax for the scheme-specific data:
>
- [CODE[//<user>:<password>@<host>:<port>/<url-path>]]
> Some or all of the parts "<user>:<password>@", ":<password>",
":<port>", and "/<url-path>" may be excluded. The scheme specific
data start with a double slash "//" to indicate that it complies with
the common Internet scheme syntax. The different components obey the
following rules:
>
:user:An optional user name. Some schemes (e.g., ftp) allow the specification of a user name.
:password:An optional password. If present, it follows the user name separated from it by a colon.
> The user name (and password), if present, are followed by a commercial at-sign "@". Within the user and password field, any ":", "@", or "/" must be encoded.
> Note that an empty user name or password is different than no user name or password; there is no way to specify a password without specifying a user name. E.g., <URL:ftp://@host.com/> has an empty user name and no password, <URL:ftp://host.com/> has no user name, while <URL:ftp://foo:@host.com/> has a user name of "foo" and an empty password.
>
:host The fully qualified domain name of a network host, or its IP address as a set of four decimal digit groups separated by ".". Fully qualified domain names take the form as described in Section 3.5 of RFC 1034 [13] and Section 2.1 of RFC 1123 [5]:a sequence of domain labels separated by ".", each domain label starting and ending with an alphanumerical character and possibly also containing "-" characters. The rightmost domain label will never start with a digit, though, which syntactically distinguishes all domain names from the IP addresses.
:port:The port number to connect to. Most schemes designate protocols that have a default port number. Another port number may optionally be supplied, in decimal, separated from the host by a colon. If the port is omitted, the colon is as well.
:url-path:The rest of the locator consists of data specific to the scheme, and is known as the "url-path". It supplies the details of how the specified resource can be accessed. Note that the "/" between the host (or port) and the url-path is NOT part of the url-path.
> The url-path syntax depends on the scheme being used, as does the manner in which it is interpreted.
]FIG]
[FIG(quote)[
[FIGCAPTION[
[458] RFC 1808 (相対 URL) 2.4.3. Parsing the Network Location/Login
]FIGCAPTION]
> If the parse string begins with a double-slash "//", then the
substring of characters after the double-slash and up to, but not
including, the next slash "/" character is the network location/login
(<net_loc>) of the URL. If no trailing slash "/" is present, the
entire remaining parse string is assigned to <net_loc>. The double-slash and <net_loc> are removed from the parse string before continuing.
解析文字列が二重斜線 [CODE(URI)[//]] から始まる場合、その二重斜線から次の斜線 [CODE(URI)[/]] 文字の手前までの部分文字列が URL のネットワーク位置・ログイン ([CODE(ABNF)[[[net_loc]]]]) です。
お尻の斜線 [CODE(URI)[/]] がない場合には、解析文字列の残りの部分全体が [CODE(ABNF)[net_loc]] に割り当てられます。
二重斜線及び [CODE(ABNF)[net_loc]] は、続行する前に解析文字列から削除します。
]FIG]
[FIG(quote)[
[FIGCAPTION[
[465] RFC 2396 (URI) 3.2. Authority Component
]FIGCAPTION]
> Many URI schemes include a top hierarchical element for a naming
authority, such that the namespace defined by the remainder of the
URI is governed by that authority. This authority component is
typically defined by an Internet-based server or a scheme-specific
registry of naming authorities.
多くの URI scheme は、最上位階層要素として命名権者を含めており、 URI の残りの部分で定義される名前空間はその命名権者の領めるところとなります。
この命名権者部品は、典型的にはインターネットを基にしたサーバー又は scheme 定義の命名権者登録簿により定義されます。
>
- [CODE(ABNF)[[DFN[authority = server | reg_name]]]]
> The authority component is preceded by a double slash "//" and is
terminated by the next slash "/", question-mark "?", or by the end of
the URI. Within the authority component, the characters ";", ":",
"@", "?", and "/" are reserved.
命名権者部品は前に二重斜線 [CODE(URI)[//]] がつき、
次の斜線 [CODE(URI)[/]], 疑問符 [CODE(URI)[?]]
又は URI の末端により終端されます。
命名権者部品中では、文字 [CODE(URI)[;]],
[CODE(URI)[:]], [CODE(URI)[@]],
[CODE(URI)[?]], [CODE(URI)[/]] が[[予約]]されています。
> An authority component is not required for a URI scheme to make use
of relative references. A base URI without an authority component
implies that any relative reference will also be without an authority component.
命名権者部品は、 URI scheme が相対参照を使うために必須ではありません。
命名権者部品なしの[[基底URI]] は、
全ての相対参照が命名権者部品のやはり欠けたものであることを暗に示します。
* 3.2.1. Registry-based Naming Authority
> The structure of a registry-based naming authority is specific to the
URI scheme, but constrained to the allowed characters for an
authority component.
登録簿を基にした命名権者は URI scheme に特有のものですが、
命名権者部品で許される文字に制約されます。
>
- [CODE(ABNF)[[DFN[reg_name]] = 1*( [[unreserved]] | [[escaped]] | "$" | "," | ";" | ":" | "@" | "&" | "=" | "+" )]]
* 3.2.2. Server-based Naming Authority
> URL schemes that involve the direct use of an IP-based protocol to a
specified server on the Internet use a common syntax for the server
component of the URI's scheme-specific data:
インターネットの特定のサーバーに対する
IP を基にしたプロトコルの直接使用を含んだ URL scheme
は、 URI の scheme 特定データのサーバー部品に共通の構文を使います。
>
- [CODE[<userinfo>@<host>:<port>]]
> where <userinfo> may consist of a user name and, optionally, scheme-specific information about how to gain authorization to access the server. The parts "<userinfo>@" and ":<port>" may be omitted.
ここで、 [CODE[userinfo]] は利用者の名前を入れることができて、任意選択によって、サーバーに接続するための認証の方法についての scheme 特有の情報をも入れることができます。
[CODE[<userinfo>@]] の部分と [CODE[:<port>]] の部分アh省略可能です。
>
- [CODE(ABNF)[[DFN[server]] = [ [ [[userinfo]] "@" ] [[hostport]] ] ]]
> The user information, if present, is followed by a commercial at-sign "@".
利用者情報を示す場合は、その後に単価記号 [CODE(URI)[@]] が続きます。
>
- [CODE(ABNF)[[DFN[userinfo]] = *( [[unreserved]] | [[escaped]] | ";" | ":" | "&" | "=" | "+" | "$" | "," )]]
> Some URL schemes use the format "user:password" in the userinfo
field. This practice is NOT RECOMMENDED, because the passing of
authentication information in clear text (such as URI) has proven to
be a security risk in almost every case where it has been used.
URL scheme によっては、 [CODE(ABNF)[userinfo]]
欄に [CODE[[VAR[user]]:[VAR[password]]]] の書式を使います。
この慣習は、認証情報を[[平文]] (URI とか。)
で渡すことはその使用されるほとんど全ての場合に置いて安全上の危険を負うこととなるので、'''推奨しません'''。
> The host is a domain name of a network host, or its IPv4 address as a
set of four decimal digit groups separated by ".". Literal IPv6
addresses are not supported.
[CODE(ABNF)[[[host]]]] は、ネットワーク・ホストのドメイン名か、その [[IPv4アドレス]]を [CODE(URI)[.]] で分離した4つの10進数集団の集合としたものです。
生 [[IPv6アドレス]]には対応していません。
>
- [CODE(ABNF)[[DFN[[[hostport]]]] = host [ ":" [[port]] ] ]]
- [CODE(ABNF)[[DFN[host]] = hostname | [[IPv4address]]]]
- [CODE(ABNF)[[DFN[hostname]] = *( domainlabel "." ) toplabel [ "." ] ]]
- [CODE(ABNF)[[DFN[domainlabel]] = [[alphanum]] | alphanum *( alphanum | "-" ) alphanum]]
- [CODE(ABNF)[[DFN[toplabel]] = alpha | alpha *( alphanum | "-" ) alphanum]]
- [CODE(ABNF)[[DFN[IPv4address]] = 1*digit "." 1*digit "." 1*digit "." 1*digit]]
- [CODE(ABNF)[[DFN[port]] = *digit]]
> Hostnames take the form described in Section 3 of [RFC1034] and Section 2.1 of [RFC1123]: a sequence of domain labels separated by ".", each domain label starting and ending with an alphanumeric character and possibly also containing "-" characters. The rightmost domain label of a fully qualified domain name will never start with a digit, thus syntactically distinguishing domain names from IPv4 addresses, and may be followed by a single "." if it is necessary to distinguish between the complete domain name and any local domain. To actually be "Uniform" as a resource locator, a URL hostname should be a fully qualified domain name. In practice, however, the host component may be a local domain literal.
ホスト名は、 RFC 1034 の3章と RFC 1123 の2.1章で説明されている形を取りました。 [CODE[.]] で分離されたドメイン札の連続体で、それぞれのドメイン札は英数字で始まり英数字で終わり、 [CODE[-]] を含めることもできます。[[完全修飾ドメイン名]]の再右ドメイン札は数字で始まることはないので、 IPv4 アドレスとドメイン名を構文的に区別できますし、完全などメイン名と局所ドメインを区別する必要がある時には単一の [CODE[.]] を続けることができます。
真に「統一」された資源位置子であるためには、 URL
ホスト名は完全修飾名であるべきです。しかし、実際にはホスト部品は局所ドメイン札かもしれません。
> Note: A suitable representation for including a literal IPv6
address as the host part of a URL is desired, but has not yet been
determined or implemented in practice.
注意 : URL のホスト部分として生 IPv6 アドレスを含める適当な表現が望まれますが、まだ決定していませんし実際に実装されてもいません。
> The port is the network port number for the server. Most schemes
designate protocols that have a default port number. Another port
number may optionally be supplied, in decimal, separated from the
host by a colon. If the port is omitted, the default port number is assumed.
[CODE(ABNF)[port]] は、サーバーのネットワーク・ポート番号です。ほとんどの scheme は既定ポート番号のあるプロトコルを指示しています。
他のポート番号は省略可能ですが10進数で [CODE(ABNF)[host]]
とコロンで区切って指定して構いません。
[CODE(ABNF)[port]] が省略されている時には、
既定ポート番号が仮定されます。
]FIG]
** RFC 2732 (IPv6 アドレス in URI)
→[[RFC 2732]]
* メモ
- [1] ''834489 - Internet Explorer で HTTP URL と HTTPS URL のユーザー情報を処理する際のデフォルトの動作を変更するソフトウェア アップデートのリリースについて'' <http://support.microsoft.com/default.aspx?scid=kb;ja;834489>: [[WinIE3]]+ で対応していた [CODE(URI)[[[http]]]] および [CODE(URI)[[[https]]]] の user:password@ は、見かけ上の URI 参照を偽装することができる脆弱性が見つかりました。その対策 ([[WinIE5]]〜[[WinIE6]] 対象) で、 user:password@ が既定ではまったく使えなくされました。
[2]
[CODE(URI)[[[dcp.tcp.pft]]:]] [[URI scheme]]
は [[RFC 2396]] 的には構文的に適当でしたが、
[[RFC 3986]] で駄目になっちゃいました。
[CITE[[#XERCESJ-1060] anyURI validation is too strict - ASF JIRA]] <http://issues.apache.org/jira/browse/XERCESJ-1060>
[CITE[Reg-name conflict between 2396 and 3986]]
<mid:4256B135.3070900@metalab.unc.edu>
([[名無しさん]])
[3]
[CITE[Computer Security Research - McAfee Avert Labs Blog]] ([CODE[2007-01-23 20:48:55 +09:00]] 版) <http://www.avertlabs.com/research/blog/?p=178>
([[名無しさん]] [WEAK[2007-01-23 11:55:04 +00:00]])
[4]
[CITE[ITmedia エンタープライズ:8進数や16進数で検出回避する新手のスパム]] ([CODE[2007-01-23 20:46:26 +09:00]] 版) <http://www.itmedia.co.jp/enterprise/articles/0701/23/news016.html>
([[名無しさん]] [WEAK[2007-01-23 11:55:38 +00:00]])
[5]
[CITE@en[IEBlog : URLs in Internet Explorer 7]] ([CODE[2007-02-22 09:21:45 +09:00]] 版) <http://blogs.msdn.com/ie/archive/2005/08/15/452006.aspx>
([[名無しさん]] [WEAK[2007-02-22 00:24:26 +00:00]])
[6]
[CITE@en-us[IP Version 6 Support]] ([CODE[2007-02-22 09:23:49 +09:00]] 版) <http://msdn2.microsoft.com/en-us/library/aa385325.aspx>
([[名無しさん]] [WEAK[2007-02-22 00:24:58 +00:00]])
[7]
[CITE@en[IEBlog : IPv6 URIs in IE7]] ([CODE[2007-02-22 09:21:53 +09:00]] 版) <http://blogs.msdn.com/ie/archive/2007/02/20/ipv6-uris-in-ie7.aspx>
([[名無しさん]] [WEAK[2007-02-22 00:30:32 +00:00]])
[8]
[CITE@ja[Internet Explorer では Web サイト アドレス (HTTP URL および HTTPS URL) に含まれるユーザー名およびパスワードがサポートされない]] ([TIME[2009-04-12 12:20:01 +09:00]] 版) <http://support.microsoft.com/kb/834489/ja>
[402] [CITE[IRC logs: freenode / #whatwg / 20100423]]
([TIME[2010-05-09 21:36:01 +09:00]] 版)
<http://krijnhoetmer.nl/irc-logs/whatwg/20100423#l-689>
[404] [CITE@en[ドット付き 10 進数 URL の不明瞭化 | Symantec Connect Community]]
( ([TIME[2011-05-15 13:47:42 +09:00]] 版))
<http://www.symantec.com/connect/blogs/10-url>
[405] [CITE[IPアドレスによるURL偽装手法まとめ | Rubusig]]
( ([TIME[2011-05-15 13:56:45 +09:00]] 版))
<http://m1n0x.hp2.jp/blog/archives/737>
[406] [CITE@ja-JP[変なIPに書き換えても繋がるかテスト]]
( ([TIME[2011-05-15 15:55:28 +09:00]] 版))
<http://abc.s65.xrea.com/1/>
[421] [CITE[Bug 10326 – make "user:password" in URLs a SYNTAX_ERR]]
( ([TIME[2011-11-14 22:12:15 +09:00]] 版))
<http://www.w3.org/Bugs/Public/show_bug.cgi?id=10326>
[422] [CITE@en[draft-carpenter-6man-uri-zoneid-00 - Representing IPv6 Zone Identifiers in Uniform Resource Identifiers]]
( ([TIME[2011-12-07 18:52:36 +09:00]] 版))
<http://tools.ietf.org/html/draft-carpenter-6man-uri-zoneid-00>
[426] [CITE[''''''[''''''whatwg'''''']'''''' URL: IPv6 parsing and model/serializing]]
( ([TIME[2012-11-17 11:03:16 +09:00]] 版))
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-November/037924.html>
[456] [CITE[Forbid domains containing ''''''['''''' and '''''']'''''' to reduce IPv6 parsing weirdness · 3cd5c10 · whatwg/url]]
( ([TIME[2014-06-26 13:23:00 +09:00]] 版))
<https://github.com/whatwg/url/commit/3cd5c107425d7feff015ab4c393636cb14eb488d>
[FIG(quote)[
[FIGCAPTION[
[18] [CITE@en[Connection String URI Format — MongoDB Manual 2.6.7]]
([TIME[2015-01-24 08:01:19 +09:00]] 版)
<http://docs.mongodb.org/manual/reference/connection-string/>
]FIGCAPTION]
> The following connects to a replica set with three members running on localhost on ports 27017, 27018, and 27019:
> mongodb://localhost,localhost:27018,localhost:27019
]FIG]
[FIG(quote)[
[FIGCAPTION[
[19] [CITE[Module ngx_http_proxy_module]]
([TIME[2015-02-26 15:57:24 +09:00]] 版)
<http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass>
]FIGCAPTION]
> or as a UNIX-domain socket path specified after the word “unix” and enclosed in colons:
> proxy_pass http://unix:/tmp/backend.socket:/uri/;
]FIG]
[26] [CITE@en[700999 – Firefox does not appear to support IPv6 link-local addresses]]
([TIME[2015-04-04 11:02:46 +09:00]] 版)
<https://bugzilla.mozilla.org/show_bug.cgi?id=700999>
[27] [CITE@en[Bug 27234 – Support IPv6 link-local addresses?]]
([TIME[2015-04-04 11:02:53 +09:00]] 版)
<https://www.w3.org/Bugs/Public/show_bug.cgi?id=27234>
[28] [CITE@en[Anne van Kesteren on Twitter: "@sleevi_ @mnot pointers? The bug against Gecko was filed by users. I filed it against URL when the networking team asked me about it."]]
([TIME[2015-04-04 10:58:25 +09:00]] 版)
<https://twitter.com/annevk/status/584039291501862913>
[29] [CITE[Link-local IPv6 addresses in URIs]]
([TIME[2012-05-08 04:05:10 +09:00]] 版)
<http://www.ietf.org/mail-archive/web/ipv6/current/msg14975.html>
[30] [CITE[Issue 70762 - chromium - Can't specify ScopeID when using link-local IPv6 address. - An open-source project to help move the web forward. - Google Project Hosting]]
([TIME[2015-04-04 11:10:21 +09:00]] 版)
<https://code.google.com/p/chromium/issues/detail?id=70762>
[FIG(quote)[
[FIGCAPTION[
[37] [CITE@en[draft-fielding-url-syntax-04 - Uniform Resource Locators (URL): Generic Syntax and Semantics]]
([TIME[2015-01-25 21:50:26 +09:00]] 版)
<https://tools.ietf.org/html/draft-fielding-url-syntax-04>
]FIGCAPTION]
>
> 1. We need to define a mechanism for using IPv6 addresses in the
> URL hostname which will not break existing systems too badly.
> Proposal: *hex *'''['''"." *hex''']''' ".ipv6"
> I.e., treat the top level domain of "ipv6" as special.
]FIG]
[FIG(quote)[
[FIGCAPTION[
[38] [CITE[<data> | Android Developers]]
([TIME[2015-06-09 13:06:52 +09:00]] 版)
<http://developer.android.com/guide/topics/manifest/data-element.html>
]FIGCAPTION]
> Note: host name matching in the Android framework is case-sensitive, unlike the formal RFC. As a result, you should always specify host names using lowercase letters.
]FIG]
[39] [CITE@en[Bug 27254 – Semantics of 'host' component incompatible with some deployed schemes]]
([TIME[2015-06-19 18:31:08 +09:00]] 版)
<https://www.w3.org/Bugs/Public/show_bug.cgi?id=27254>
[FIG(quote)[
[FIGCAPTION[
[40] [CITE@en[RFC 2718 - Guidelines for new URL Schemes]]
([TIME[2015-05-17 15:15:23 +09:00]] 版)
<https://tools.ietf.org/html/rfc2718#section-2.1.2>
]FIGCAPTION]
> RL
> schemes which do not contain a conformant hierarchical structure in
> their <scheme-specific-part> should not use double slashes following
> the "<scheme>:" string.
>
]FIG]