idnits 2.17.00 (12 Aug 2021) /tmp/idnits30153/draft-fielding-uri-rfc2396bis-00.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Looks like you're using RFC 2026 boilerplate. This must be updated to follow RFC 3978/3979, as updated by RFC 4748. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- == No 'Intended status' indicated for this document; assuming Proposed Standard Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** The document seems to lack a both a reference to RFC 2119 and the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. RFC 2119 keyword, line 644: '... practice is NOT RECOMMENDED, because ...' Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the RFC 3978 Section 5.4 Copyright Line does not match the current year -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (October 28, 2002) is 7144 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Possible downref: Non-RFC (?) normative reference: ref. 'ASCII' ** Obsolete normative reference: RFC 2234 (Obsoleted by RFC 4234) ** Downref: Normative reference to an Unknown state RFC: RFC 952 ** Obsolete normative reference: RFC 2373 (Obsoleted by RFC 3513) ** Obsolete normative reference: RFC 2279 (ref. 'UTF-8') (Obsoleted by RFC 3629) -- Obsolete informational reference (is this intentional?): RFC 1738 (Obsoleted by RFC 4248, RFC 4266) -- Obsolete informational reference (is this intentional?): RFC 1866 (Obsoleted by RFC 2854) -- Obsolete informational reference (is this intentional?): RFC 2396 (Obsoleted by RFC 3986) -- Obsolete informational reference (is this intentional?): RFC 1808 (Obsoleted by RFC 3986) -- Obsolete informational reference (is this intentional?): RFC 2518 (Obsoleted by RFC 4918) -- Obsolete informational reference (is this intentional?): RFC 2732 (Obsoleted by RFC 3986) -- Obsolete informational reference (is this intentional?): RFC 2110 (Obsoleted by RFC 2557) -- Obsolete informational reference (is this intentional?): RFC 2717 (Obsoleted by RFC 4395) Summary: 7 errors (**), 0 flaws (~~), 2 warnings (==), 12 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group T. Berners-Lee 3 Internet-Draft MIT/LCS 4 Expires: April 28, 2003 R. Fielding 5 Day Software 6 L. Masinter 7 Adobe 8 October 28, 2002 10 Uniform Resource Identifier (URI): Generic Syntax 11 draft-fielding-uri-rfc2396bis-00 13 Status of this Memo 15 This document is an Internet-Draft and is in full conformance with 16 all provisions of Section 10 of RFC2026. 18 Internet-Drafts are working documents of the Internet Engineering 19 Task Force (IETF), its areas, and its working groups. Note that 20 other groups may also distribute working documents as Internet- 21 Drafts. 23 Internet-Drafts are draft documents valid for a maximum of six months 24 and may be updated, replaced, or obsoleted by other documents at any 25 time. It is inappropriate to use Internet-Drafts as reference 26 material or to cite them other than as "work in progress." 28 The list of current Internet-Drafts can be accessed at http:// 29 www.ietf.org/ietf/1id-abstracts.txt. 31 The list of Internet-Draft Shadow Directories can be accessed at 32 http://www.ietf.org/shadow.html. 34 This Internet-Draft will expire on April 28, 2003. 36 Copyright Notice 38 Copyright (C) The Internet Society (2002). All Rights Reserved. 40 Abstract 42 A Uniform Resource Identifier (URI) is a compact string of characters 43 for identifying an abstract or physical resource. This document 44 defines the generic syntax of a URI, including both absolute and 45 relative forms, and guidelines for their use. 47 This document defines a grammar that is a superset of all valid URI, 48 such that an implementation can parse the common components of a URI 49 reference without knowing the scheme-specific requirements of every 50 possible identifier type. This document does not define a generative 51 grammar for all URIs; that task will be performed by the individual 52 specifications of each URI scheme. 54 Editorial Note 56 Discussion of this draft and comments to the editors should be sent 57 to the uri@w3.org mailing list. An issues list and version history 58 is available at . 60 Table of Contents 62 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 63 1.1 Overview of URIs . . . . . . . . . . . . . . . . . . . . . . 4 64 1.2 URI, URL, and URN . . . . . . . . . . . . . . . . . . . . . 5 65 1.3 Example URIs . . . . . . . . . . . . . . . . . . . . . . . . 6 66 1.4 Hierarchical URIs and Relative Forms . . . . . . . . . . . . 6 67 1.5 URI Transcribability . . . . . . . . . . . . . . . . . . . . 7 68 1.6 Syntax Notation and Common Elements . . . . . . . . . . . . 8 69 2. URI Characters and Escape Sequences . . . . . . . . . . . . 9 70 2.1 URIs and non-ASCII characters . . . . . . . . . . . . . . . 9 71 2.2 Reserved Characters . . . . . . . . . . . . . . . . . . . . 10 72 2.3 Unreserved Characters . . . . . . . . . . . . . . . . . . . 11 73 2.4 Escape Sequences . . . . . . . . . . . . . . . . . . . . . . 11 74 2.4.1 Escaped Encoding . . . . . . . . . . . . . . . . . . . . . . 11 75 2.4.2 When to Escape and Unescape . . . . . . . . . . . . . . . . 11 76 2.4.3 Excluded US-ASCII Characters . . . . . . . . . . . . . . . . 12 77 3. URI Syntactic Components . . . . . . . . . . . . . . . . . . 13 78 3.1 Scheme Component . . . . . . . . . . . . . . . . . . . . . . 14 79 3.2 Authority Component . . . . . . . . . . . . . . . . . . . . 14 80 3.2.1 Registry-based Naming Authority . . . . . . . . . . . . . . 15 81 3.2.2 Server-based Naming Authority . . . . . . . . . . . . . . . 15 82 3.3 Path Component . . . . . . . . . . . . . . . . . . . . . . . 17 83 3.4 Query Component . . . . . . . . . . . . . . . . . . . . . . 18 84 4. URI References . . . . . . . . . . . . . . . . . . . . . . . 19 85 4.1 Fragment Identifier . . . . . . . . . . . . . . . . . . . . 19 86 4.2 Same-document References . . . . . . . . . . . . . . . . . . 20 87 4.3 Parsing a URI Reference . . . . . . . . . . . . . . . . . . 20 88 5. Relative URI References . . . . . . . . . . . . . . . . . . 21 89 5.1 Establishing a Base URI . . . . . . . . . . . . . . . . . . 22 90 5.1.1 Base URI within Document Content . . . . . . . . . . . . . . 23 91 5.1.2 Base URI from the Encapsulating Entity . . . . . . . . . . . 23 92 5.1.3 Base URI from the Retrieval URI . . . . . . . . . . . . . . 24 93 5.1.4 Default Base URI . . . . . . . . . . . . . . . . . . . . . . 24 94 5.2 Resolving Relative References to Absolute Form . . . . . . . 24 95 6. URI Normalization and Equivalence . . . . . . . . . . . . . 28 96 7. Security Considerations . . . . . . . . . . . . . . . . . . 29 97 8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 30 98 Normative References . . . . . . . . . . . . . . . . . . . . 31 99 Non-normative References . . . . . . . . . . . . . . . . . . 32 100 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . 33 101 A. Collected BNF for URI . . . . . . . . . . . . . . . . . . . 34 102 B. Parsing a URI Reference with a Regular Expression . . . . . 36 103 C. Examples of Resolving Relative URI References . . . . . . . 37 104 C.1 Normal Examples . . . . . . . . . . . . . . . . . . . . . . 37 105 C.2 Abnormal Examples . . . . . . . . . . . . . . . . . . . . . 37 106 D. Embedding the Base URI in HTML documents . . . . . . . . . . 39 107 E. Recommendations for Delimiting URI in Context . . . . . . . 40 108 F. Abbreviated URIs . . . . . . . . . . . . . . . . . . . . . . 42 109 G. Summary of Non-editorial Changes . . . . . . . . . . . . . . 43 110 G.1 Additions . . . . . . . . . . . . . . . . . . . . . . . . . 43 111 G.2 Modifications from RFC 2396 . . . . . . . . . . . . . . . . 43 112 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 113 Full Copyright Statement . . . . . . . . . . . . . . . . . . 48 115 1. Introduction 117 A Uniform Resource Identifier (URI) provides a simple and extensible 118 means for identifying a resource. This specification of URI syntax 119 and semantics is derived from concepts introduced by the World Wide 120 Web global information initiative, whose use of such objects dates 121 from 1990 and is described in "Universal Resource Identifiers in WWW" 122 [RFC1630], and is designed to meet the recommendations laid out in 123 "Functional Recommendations for Internet Resource Locators" [RFC1736] 124 and "Functional Requirements for Uniform Resource Names" [RFC1737]. 126 This document obsoletes [RFC2396], which merged "Uniform Resource 127 Locators" [RFC1738] and "Relative Uniform Resource Locators" 128 [RFC1808] in order to define a single, generic syntax for all URIs. 129 It excludes those portions of RFC 1738 that defined the specific 130 syntax of individual URI schemes; those portions will be updated as 131 separate documents. The process for registration of new URI schemes 132 is defined separately by [RFC2717]. 134 All significant changes from RFC 2396 are noted in Appendix G. 136 1.1 Overview of URIs 138 URIs are characterized by the following definitions: 140 Uniform 142 Uniformity provides several benefits: it allows different types of 143 resource identifiers to be used in the same context, even when the 144 mechanisms used to access those resources may differ; it allows 145 uniform semantic interpretation of common syntactic conventions 146 across different types of resource identifiers; it allows 147 introduction of new types of resource identifiers without 148 interfering with the way that existing identifiers are used; and, 149 it allows the identifiers to be reused in many different contexts, 150 thus permitting new applications or protocols to leverage a pre- 151 existing, large, and widely-used set of resource identifiers. 153 Resource 155 A resource can be anything that has identity. Familiar examples 156 include an electronic document, an image, a service (e.g., 157 "today's weather report for Los Angeles"), and a collection of 158 other resources. Not all resources are network "retrievable"; 159 e.g., human beings, corporations, and bound books in a library can 160 also be considered resources. 162 The resource is the conceptual mapping to an entity or set of 163 entities, not necessarily the entity which corresponds to that 164 mapping at any particular instance in time. Thus, a resource can 165 remain constant even when its content---the entities to which it 166 currently corresponds---changes over time, provided that the 167 conceptual mapping is not changed in the process. 169 Identifier 171 An identifier is an object that can act as a reference to 172 something that has identity. In the case of a URI, the object is 173 a sequence of characters with a restricted syntax. 175 Having identified a resource, a system may perform a variety of 176 operations on the resource, as might be characterized by such words 177 as `access', `update', `replace', or `find attributes'. 179 1.2 URI, URL, and URN 181 A URI can be further classified as a locator, a name, or both. The 182 term "Uniform Resource Locator" (URL) refers to the subset of URIs 183 that, in addition to identifying the resource, provide a means of 184 locating the resource by describing its primary access mechanism 185 (e.g., its network "location"). The term "Uniform Resource Name" 186 (URN) refers to the subset of URIs that are required to remain 187 globally unique and persistent even when the resource ceases to exist 188 or becomes unavailable. 190 An individual scheme does not need to be cast into one of a discrete 191 set of URI types such as "URL", "URN", "URC", etc. Any given URI 192 scheme may define subspaces that have the characteristics of a name, 193 a locator, or both, often depending on the persistence and care in 194 the assignment of identifiers by the naming authority, rather than on 195 any quality of the URI scheme. For that reason, this specification 196 deprecates use of the terms URL or URN to distinguish between 197 schemes, instead using the term URI throughout. 199 Each URI scheme (Section 3.1) defines the namespace of the URI, and 200 thus may further restrict the syntax and semantics of identifiers 201 using that scheme. This specification defines those elements of the 202 URI syntax that are either required of all URI schemes or are common 203 to many URI schemes. It thus defines the syntax and semantics that 204 are needed to implement a scheme-independent parsing mechanism for 205 URI references, such that the scheme-dependent handling of a URI can 206 be postponed until the scheme-dependent semantics are needed. 208 Although many URI schemes are named after protocols, this does not 209 imply that use of such a URI will result in access to the resource 210 via the named protocol. URIs are often used in contexts that are 211 purely for identification, just like any other identifier. Even when 212 a URI is used to obtain a representation of a resource, that access 213 might be through gateways, proxies, caches, and name resolution 214 services that are independent of the protocol of the resource origin, 215 and the resolution of some URIs may require the use of more than one 216 protocol (e.g., both DNS and HTTP are typically used to access an 217 "http" URI's resource when it can't be found in a local cache). 219 A parser of the generic URI syntax is capable of parsing any URI 220 reference into its major components; once the scheme is determined, 221 further scheme-specific parsing can be performed on the components. 222 In other words, the URI generic syntax is a superset of the syntax of 223 all URI schemes. 225 1.3 Example URIs 227 The following examples illustrate URIs that are in common use. 229 ftp://ftp.is.co.za/rfc/rfc1808.txt 230 -- ftp scheme for File Transfer Protocol services 232 gopher://gopher.tc.umn.edu:70/11/Mailing%20Lists/ 233 -- gopher scheme for Gopher and Gopher+ Protocol services 235 http://www.ietf.org/rfc/rfc2396.txt 236 -- http scheme for Hypertext Transfer Protocol services 238 mailto:John.Doe@example.com 239 -- mailto scheme for electronic mail addresses 241 news:comp.infosystems.www.servers.unix 242 -- news scheme for USENET news groups and articles 244 telnet://melvyl.ucop.edu/ 245 -- telnet scheme for interactive TELNET services 247 1.4 Hierarchical URIs and Relative Forms 249 An absolute identifier refers to a resource independent of the 250 context in which the identifier is used. In contrast, a relative 251 identifier refers to a resource by describing the difference within a 252 hierarchical namespace between the current context and an absolute 253 identifier of the resource. 255 Some URI schemes support a hierarchical naming system, where the 256 hierarchy of the name is denoted by a "/" delimiter separating the 257 components in the scheme. This document defines a scheme-independent 258 `relative' form of URI reference that can be used in conjunction with 259 a `base' URI of a hierarchical scheme to produce the `absolute' URI 260 form of the reference. The syntax of a hierarchical URI is described 261 in Section 3; the relative URI calculation is described in Section 5. 263 1.5 URI Transcribability 265 The URI syntax was designed with global transcribability as one of 266 its main concerns. A URI is a sequence of characters from a very 267 limited set, i.e. the letters of the basic Latin alphabet, digits, 268 and a few special characters. A URI may be represented in a variety 269 of ways: e.g., ink on paper, pixels on a screen, or a sequence of 270 octets in a coded character set. The interpretation of a URI depends 271 only on the characters used and not how those characters are 272 represented in a network protocol. 274 The goal of transcribability can be described by a simple scenario. 275 Imagine two colleagues, Sam and Kim, sitting in a pub at an 276 international conference and exchanging research ideas. Sam asks Kim 277 for a location to get more information, so Kim writes the URI for the 278 research site on a napkin. Upon returning home, Sam takes out the 279 napkin and types the URI into a computer, which then retrieves the 280 information to which Kim referred. 282 There are several design concerns revealed by the scenario: 284 o A URI is a sequence of characters, which is not always represented 285 as a sequence of octets. 287 o A URI may be transcribed from a non-network source, and thus 288 should consist of characters that are most likely to be able to be 289 typed into a computer, within the constraints imposed by keyboards 290 (and related input devices) across languages and locales. 292 o A URI often needs to be remembered by people, and it is easier for 293 people to remember a URI when it consists of meaningful 294 components. 296 These design concerns are not always in alignment. For example, it 297 is often the case that the most meaningful name for a URI component 298 would require characters that cannot be typed into some systems. The 299 ability to transcribe the resource identifier from one medium to 300 another was considered more important than having its URI consist of 301 the most meaningful of components. In local and regional contexts 302 and with improving technology, users might benefit from being able to 303 use a wider range of characters; such use is not defined in this 304 document. 306 1.6 Syntax Notation and Common Elements 308 This document uses two conventions to describe and define the syntax 309 for URI. The first, called the layout form, is a general description 310 of the order of components and component separators, as in 312 /;? 314 The component names are enclosed in angle-brackets and any characters 315 outside angle-brackets are literal separators. Whitespace should be 316 ignored. These descriptions are used informally and do not define 317 the syntax requirements. 319 The second convention is a formal grammar defined using the Augmented 320 Backus-Naur Form (ABNF) notation of [RFC2234]. Although the ABNF 321 defines syntax in terms of the ASCII character encoding [ASCII], the 322 URI syntax should be interpreted in terms of the character that the 323 ASCII-encoded octet represents, rather than the octet encoding 324 itself. How a URI is represented in terms of bits and bytes on the 325 wire is dependent upon the character encoding of the protocol used to 326 transport it, or the charset of the document that contains it. 328 The complete URI syntax is collected in Appendix A. 330 2. URI Characters and Escape Sequences 332 A URI consists of a restricted set of characters, primarily chosen 333 to aid transcribability and usability both in computer systems and in 334 non-computer communications. Characters used conventionally as 335 delimiters around a URI are excluded. The restricted set of 336 characters consists of digits, letters, and a few graphic symbols 337 chosen from those common to most of the character encodings and input 338 facilities available to Internet users. 340 uric = reserved / unreserved / escaped 342 Within a URI, characters are either used as delimiters or to 343 represent strings of data (octets) within the delimited portions. 344 Octets are either represented directly by a character (using the US- 345 ASCII character for that octet [ASCII]) or by an escape encoding. 346 This representation is elaborated below. 348 2.1 URIs and non-ASCII characters 350 The relationship between URIs and characters has been a source of 351 confusion for characters that are not part of US-ASCII. To describe 352 the relationship, it is useful to distinguish between a "character" 353 (as a distinguishable semantic entity) and an "octet" (an 8-bit 354 byte). There are two mappings, one from URI characters to octets, 355 and a second from octets to original characters: 357 URI character sequence->octet sequence->original character sequence 359 A URI is represented as a sequence of characters, not as a sequence 360 of octets. That is because a URI might be "transported" by means 361 that are not through a computer network, e.g., printed on paper, read 362 over the radio, etc. 364 A URI scheme may define a mapping from URI characters to octets; 365 whether this is done depends on the scheme. Commonly, within a 366 delimited component of a URI, a sequence of characters may be used to 367 represent a sequence of octets. For example, the character "a" 368 represents the octet 97 (decimal), while the character sequence "%", 369 "0", "a" represents the octet 10 (decimal). 371 There is a second translation for some resources: the sequence of 372 octets defined by a component of the URI is subsequently used to 373 represent a sequence of characters. A 'charset' defines this 374 mapping. There are many charsets in use in Internet protocols. For 375 example, UTF-8 [UTF-8] defines a mapping from sequences of octets to 376 sequences of characters in the repertoire of ISO 10646. 378 In the simplest case, the original character sequence contains only 379 characters that are defined in US-ASCII, and the two levels of 380 mapping are simple and easily invertible: each 'original character' 381 is represented as the octet for the US-ASCII code for it, which is, 382 in turn, represented as either the US-ASCII character, or else the 383 "%" escape sequence for that octet. 385 For original character sequences that contain non-ASCII characters, 386 however, the situation is more difficult. Internet protocols that 387 transmit octet sequences intended to represent character sequences 388 are expected to provide some way of identifying the charset used, if 389 there might be more than one [RFC2277]. However, there is currently 390 no provision within the generic URI syntax to accomplish this 391 identification. An individual URI scheme may require a single 392 charset, define a default charset, or provide a way to indicate the 393 charset used. 395 It is expected that a systematic treatment of character encoding 396 within URIs will be developed as a future modification of this 397 specification. 399 2.2 Reserved Characters 401 Many URI include components consisting of or delimited by, certain 402 special characters. These characters are called "reserved", since 403 their usage within the URI component is limited to their reserved 404 purpose. If the data for a URI component would conflict with the 405 reserved purpose, then the conflicting data must be escaped before 406 forming the URI. 408 reserved = "[" / "]" / ";" / "/" / "?" / 409 ":" / "@" / "&" / "=" / "+" / "$" / "," 411 The "reserved" syntax class above refers to those characters that are 412 allowed within a URI, but which may not be allowed within a 413 particular component of the generic URI syntax; they are used as 414 delimiters of the components described in Section 3. 416 Characters in the "reserved" set are not reserved in all contexts. 417 The set of characters actually reserved within any given URI 418 component is defined by that component. In general, a character is 419 reserved if the semantics of the URI changes if the character is 420 replaced with its escaped US-ASCII encoding. 422 2.3 Unreserved Characters 424 Data characters that are allowed in a URI but do not have a reserved 425 purpose are called unreserved. These include upper and lower case 426 letters, decimal digits, and a limited set of punctuation marks and 427 symbols. 429 unreserved = ALPHA / DIGIT / mark 431 mark = "-" / "_" / "." / "!" / "~" / "*" / "'" / "(" / ")" 433 Unreserved characters can be escaped without changing the semantics 434 of the URI, but this should not be done unless the URI is being used 435 in a context that does not allow the unescaped character to appear. 437 2.4 Escape Sequences 439 Data must be escaped if it does not have a representation using an 440 unreserved character; this includes data that does not correspond to 441 a printable character of the US-ASCII coded character set, or that 442 corresponds to any US-ASCII character that is disallowed, as 443 explained below. 445 2.4.1 Escaped Encoding 447 An escaped octet is encoded as a character triplet, consisting of 448 the percent character "%" followed by the two hexadecimal digits 449 representing the octet code. For example, "%20" is the escaped 450 encoding for the US-ASCII space character. 452 escaped = "%" HEXDIG HEXDIG 454 2.4.2 When to Escape and Unescape 456 A URI is always in an "escaped" form, since escaping or unescaping a 457 completed URI might change its semantics. Normally, the only time 458 escape encodings can safely be made is when the URI is being created 459 from its component parts; each component may have its own set of 460 characters that are reserved, so only the mechanism responsible for 461 generating or interpreting that component can determine whether or 462 not escaping a character will change its semantics. Likewise, a URI 463 must be separated into its components before the escaped characters 464 within those components can be safely decoded. 466 In some cases, data that could be represented by an unreserved 467 character may appear escaped; for example, some of the unreserved 468 "mark" characters are automatically escaped by some systems. If the 469 given URI scheme defines a canonicalization algorithm, then 470 unreserved characters may be unescaped according to that algorithm. 471 For example, "%7e" is sometimes used instead of "~" in an http URI 472 path, but the two are equivalent for an http URI. 474 Because the percent "%" character always has the reserved purpose of 475 being the escape indicator, it must be escaped as "%25" in order to 476 be used as data within a URI. Implementers should be careful not to 477 escape or unescape the same string more than once, since unescaping 478 an already unescaped string might lead to misinterpreting a percent 479 data character as another escaped character, or vice versa in the 480 case of escaping an already escaped string. 482 2.4.3 Excluded US-ASCII Characters 484 Although they are disallowed within the URI syntax, we include here a 485 description of those US-ASCII characters that have been excluded and 486 the reasons for their exclusion. 488 The control characters (CTL) in the US-ASCII coded character set are 489 not used within a URI, both because they are non-printable and 490 because they are likely to be misinterpreted by some control 491 mechanisms. 493 The space character (SP) is excluded because significant spaces may 494 disappear and insignificant spaces may be introduced when a URI is 495 transcribed or typeset or subjected to the treatment of word- 496 processing programs. Whitespace is also used to delimit a URI in 497 many contexts. 499 The angle-bracket "<" and ">" and double-quote (") characters are 500 excluded because they are often used as the delimiters around a URI 501 in text documents and protocol fields. The character "#" is excluded 502 because it is used to delimit a URI from a fragment identifier in a 503 URI reference (Section 4). The percent character "%" is excluded 504 because it is used for the encoding of escaped characters. 506 delims = "<" / ">" / "#" / "%" / DQUOTE 508 Other characters are excluded because gateways and other transport 509 agents are known to sometimes modify such characters, or they are 510 used as delimiters. 512 unwise = "{" / "}" / "|" / "\" / "^" / "`" 514 Data corresponding to excluded characters must be escaped in order to 515 be properly represented within a URI. 517 3. URI Syntactic Components 519 The URI syntax is dependent upon the scheme. In general, absolute 520 URI are written as follows: 522 : 524 An absolute URI contains the name of the scheme being used () 525 followed by a colon (":") and then a string (the ) whose interpretation depends on the scheme. 528 The URI syntax does not require that the scheme-specific-part have 529 any general structure or set of semantics which is common among all 530 URIs. However, a subset of URI do share a common syntax for 531 representing hierarchical relationships within the namespace. This 532 "generic URI" syntax consists of a sequence of four main components: 534 ://? 536 each of which, except , may be absent from a particular URI. 537 For example, some URI schemes do not allow an component, 538 and others do not use a component. 540 absolute-URI = scheme ":" ( hier-part / opaque-part ) 542 URIs that are hierarchical in nature use the slash "/" character for 543 separating hierarchical components. For some file systems, a "/" 544 character (used to denote the hierarchical structure of a URI) is the 545 delimiter used to construct a file name hierarchy, and thus the URI 546 path will look similar to a file pathname. This does NOT imply that 547 the resource is a file or that the URI maps to an actual filesystem 548 pathname. 550 hier-part = [ net-path / abs-path ] [ "?" query ] 552 net-path = "//" authority [ abs-path ] 554 abs-path = "/" path-segments 556 URIs that do not make use of the slash "/" character for separating 557 hierarchical components are considered opaque by the generic URI 558 parser. 560 opaque-part = uric-no-slash *uric 562 uric-no-slash = unreserved / escaped / "[" / "]" / ";" / "?" / 563 ":" / "@" / "&" / "=" / "+" / "$" / "," 565 We use the term to refer to both the and constructs, since they are mutually exclusive for any given URI 567 and can be parsed as a single component. 569 3.1 Scheme Component 571 Just as there are many different methods of access to resources, 572 there are a variety of schemes for identifying such resources. The 573 URI syntax consists of a sequence of components separated by reserved 574 characters, with the first component defining the semantics for the 575 remainder of the URI string. 577 Scheme names consist of a sequence of characters beginning with a 578 lower case letter and followed by any combination of lower case 579 letters, digits, plus ("+"), period ("."), or hyphen ("-"). For 580 resiliency, programs interpreting a URI should treat upper case 581 letters as equivalent to lower case in scheme names (e.g., allow 582 "HTTP" as well as "http"). 584 scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) 586 Relative URI references are distinguished from absolute URI in that 587 they do not begin with a scheme name. Instead, the scheme is 588 inherited from the base URI, as described in Section 5.2. 590 3.2 Authority Component 592 Many URI schemes include a top hierarchical element for a naming 593 authority, such that the namespace defined by the remainder of the 594 URI is governed by that authority. This authority component is 595 typically defined by an Internet-based server or a scheme-specific 596 registry of naming authorities. 598 authority = server / reg-name 600 The authority component is preceded by a double slash "//" and is 601 terminated by the next slash "/", question-mark "?", or by the end of 602 the URI. Within the authority component, the characters ";", ":", 603 "@", "?", "/", "[", and "]" are reserved. 605 An authority component is not required for a URI scheme to make use 606 of relative references. A base URI without an authority component 607 implies that any relative reference will also be without an authority 608 component. 610 3.2.1 Registry-based Naming Authority 612 The structure of a registry-based naming authority is specific to 613 the URI scheme, but constrained to the allowed characters for an 614 authority component. 616 reg-name = 1*( unreserved / escaped / ";" / 617 ":" / "@" / "&" / "=" / "+" / "$" / "," ) 619 3.2.2 Server-based Naming Authority 621 URI schemes that involve the direct use of an IP-based protocol to a 622 specified server on the Internet use a common syntax for the server 623 component of the URI's scheme-specific data: 625 @: 627 where may consist of a user name and, optionally, scheme- 628 specific information about how to gain authorization to access the 629 server. The parts "@" and ":" may be omitted. If 630 is omitted, the default host is defined by the scheme-specific 631 semantics of the URI (e.g., the "file" URI scheme defaults to 632 "localhost", whereas the "http" URI scheme does not allow host to be 633 omitted). 635 server = [ [ userinfo "@" ] hostport ] 637 The user information, if present, is followed by a commercial at- 638 sign "@". 640 userinfo = *( unreserved / escaped / ";" / 641 ":" / "&" / "=" / "+" / "$" / "," ) 643 Some URI schemes use the format "user:password" in the userinfo 644 field. This practice is NOT RECOMMENDED, because the passing of 645 authentication information in clear text has proven to be a security 646 risk in almost every case where it has been used. 648 The server is identified by a network host --- as described by an 649 IPv6 literal encapsulated within square brackets, an IPv4 address in 650 dotted-decimal form, or a domain name --- and an optional port 651 number. The server's port, if any is required by the URI scheme, can 652 be specified by a port number in decimal following the host and 653 delimited from it by a colon (":") character. If no explicit port 654 number is given, the default port number, as defined by the URI 655 scheme, is assumed. The type of network port identified by the URI 656 (e.g., TCP, UDP, SCTP, etc.) is defined by the scheme-specific 657 semantics of the URI scheme. 659 hostport = host [ ":" port ] 660 host = IPv6reference / IPv4address / hostname 661 port = *DIGIT 663 A hostname takes the form described in Section 3 of [RFC1034] and 664 Section 2.1 of [RFC1123]: a sequence of domain labels separated by 665 ".", each domain label starting and ending with an alphanumeric 666 character and possibly also containing "-" characters. The rightmost 667 domain label of a fully qualified domain name will never start with a 668 digit, thus syntactically distinguishing domain names from IPv4 669 addresses, and may be followed by a single "." if it is necessary to 670 distinguish between the complete domain name and any local domain. 672 hostname = domainlabel [ qualified ] 673 qualified = *( "." domainlabel ) [ "." toplabel [ "." ] ] 674 domainlabel = alphanum [ 0*61( alphanum | "-" ) alphanum ] 675 toplabel = alpha [ 0*61( alphanum | "-" ) alphanum ] 676 alphanum = ALPHA / DIGIT 678 A host identified by an IPv4 literal address is represented in 679 dotted-decimal notation (a sequence of four decimal numbers in the 680 range 0 to 255, separated by ".") [RFC0952]. 682 IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet 683 dec-octet = DIGIT / ; 0-9 684 ( %x31-39 DIGIT ) / ; 10-99 685 ( "1" 2*DIGIT ) / ; 100-199 686 ( "2" %x30-34 DIGIT ) / ; 200-249 687 ( "25" %x30-35 ) ; 250-255 689 A host identified by an IPv6 literal address [RFC2373] is 690 distinguished by enclosing the IPv6 literal within square-brakets 691 ("[" and "]"). This is the only place where square-bracket 692 characters are allowed in the hierarchical URI syntax. 694 IPv6reference = "[" IPv6address "]" 696 IPv6address = ( 7( h4 ":" ) h4 ) / 697 ( "::" 0*6( h4 ":" ) [ h4 ] ) / 698 ( h4 "::" 0*5( h4 ":" ) [ h4 ] ) / 699 ( h4 ":" h4 "::" 0*4( h4 ":" ) [ h4 ] ) / 700 ( h4 2( ":" h4 ) "::" 0*3( h4 ":" ) [ h4 ] ) / 701 ( h4 3( ":" h4 ) "::" 0*2( h4 ":" ) [ h4 ] ) / 702 ( h4 4( ":" h4 ) "::" 0*1( h4 ":" ) [ h4 ] ) / 703 ( 6( h4 ":" ) IPv4address ) / 704 ( "::" 0*5( h4 ":" ) IPv4address ) / 705 ( h4 "::" 0*4( h4 ":" ) IPv4address ) / 706 ( h4 ":" h4 "::" 0*3( h4 ":" ) IPv4address ) / 707 ( h4 2( ":" h4 ) "::" 0*2( h4 ":" ) IPv4address ) / 708 ( h4 3( ":" h4 ) "::" 0*1( h4 ":" ) IPv4address ) 710 h4 = 1*4HEXDIG 712 3.3 Path Component 714 The path component contains data, specific to the authority (or the 715 scheme if there is no authority component), identifying the resource 716 within the scope of that scheme and authority. 718 path = [ abs-path / opaque-part ] 720 path-segments = segment *( "/" segment ) 721 segment = *pchar 723 pchar = unreserved / escaped / ";" / 724 ":" / "@" / "&" / "=" / "+" / "$" / "," 726 The path may consist of a sequence of path segments separated by a 727 single slash "/" character. Within a path segment, the characters "/ 728 ", ";", "=", and "?" are reserved. The semicolon (";") and equals 729 ("=") characters have the reserved purpose of delimiting parameters 730 and parameter values within a path segment. However, parameters are 731 not significant to the parsing of relative references. 733 3.4 Query Component 735 The query component is a string of information to be interpreted by 736 the resource. 738 query = *( pchar / "/" / "?" ) 740 Within a query component, the characters ";", "/", "?", ":", "@", 741 "&", "=", "+", ",", and "$" are reserved. 743 4. URI References 745 The term "URI-reference" is used here to denote the common usage of 746 a resource identifier. A URI reference may be absolute or relative, 747 and may have additional information attached in the form of a 748 fragment identifier. However, "the URI" that results from such a 749 reference includes only the absolute URI after the fragment 750 identifier (if any) is removed and after any relative URI is resolved 751 to its absolute form. Although it is possible to limit the 752 discussion of URI syntax and semantics to that of the absolute 753 result, most usage of URI is within general URI references, and it is 754 impossible to obtain the URI from such a reference without also 755 parsing the fragment and resolving the relative form. 757 URI-reference = [ absolute-URI / relative-URI ] [ "#" fragment ] 759 Many protocol elements allow only the absolute form of a URI with an 760 optional fragment identifier. 762 absolute-URI-reference = absolute-URI [ "#" fragment ] 764 The syntax for a relative URI is a shortened form of that for an 765 absolute URI, where some prefix of the URI is missing and certain 766 path components ("." and "..") have a special meaning when, and only 767 when, interpreting a relative path. The relative URI syntax is 768 defined in Section 5. 770 4.1 Fragment Identifier 772 When a URI reference is used to perform a retrieval action on the 773 identified resource, the optional fragment identifier, separated from 774 the URI by a crosshatch ("#") character, consists of additional 775 reference information to be interpreted by the user agent after the 776 retrieval action has been successfully completed. As such, it is not 777 part of a URI, but is often used in conjunction with a URI. 779 fragment = *( pchar / "/" / "?" ) 781 The semantics of a fragment identifier is a property of the data 782 resulting from a retrieval action, regardless of the type of URI used 783 in the reference. Therefore, the format and interpretation of 784 fragment identifiers is dependent on the media type [RFC2046] of the 785 retrieval result. The character restrictions described in Section 2 786 for a URI also apply to the fragment in a URI-reference. Individual 787 media types may define additional restrictions or structure within 788 the fragment for specifying different types of "partial views" that 789 can be identified within that media type. 791 A fragment identifier is only meaningful when a URI reference is 792 intended for retrieval and the result of that retrieval is a document 793 for which the identified fragment is consistently defined. 795 4.2 Same-document References 797 A URI reference that does not contain a URI is a reference to the 798 current document. In other words, an empty URI reference within a 799 document is interpreted as a reference to the start of that document, 800 and a reference containing only a fragment identifier is a reference 801 to the identified fragment of that document. Traversal of such a 802 reference should not result in an additional retrieval action. 803 However, if the URI reference occurs in a context that is always 804 intended to result in a new request, as in the case of HTML's FORM 805 element, then an empty URI reference represents the base URI of the 806 current document and should be replaced by that URI when transformed 807 into a request. 809 4.3 Parsing a URI Reference 811 A URI reference is typically parsed according to the four main 812 components and fragment identifier in order to determine what 813 components are present and whether the reference is relative or 814 absolute. The individual components are then parsed for their 815 subparts and, if not opaque, to verify their validity. 817 Although the BNF defines what is allowed in each component, it is 818 ambiguous in terms of differentiating between an authority component 819 and a path component that begins with two slash characters. The 820 greedy algorithm is used for disambiguation: the left-most matching 821 rule soaks up as much of the URI reference string as it is capable of 822 matching. In other words, the authority component wins. 824 Readers familiar with regular expressions should see Appendix B for a 825 concrete parsing example and test oracle. 827 5. Relative URI References 829 It is often the case that a group or "tree" of documents has been 830 constructed to serve a common purpose; the vast majority of URIs in 831 these documents point to resources within the tree rather than 832 outside of it. Similarly, documents located at a particular site are 833 much more likely to refer to other resources at that site than to 834 resources at remote sites. 836 Relative addressing of URIs allows document trees to be partially 837 independent of their location and access scheme. For instance, it is 838 possible for a single set of hypertext documents to be simultaneously 839 accessible and traversable via each of the "file", "http", and "ftp" 840 schemes if the documents refer to each other using relative URIs. 841 Furthermore, such document trees can be moved, as a whole, without 842 changing any of the relative references. Experience within the WWW 843 has demonstrated that the ability to perform relative referencing is 844 necessary for the long-term usability of embedded URIs. 846 The relative URI syntax takes advantage of the syntax of 847 (Section 3) in order to express a reference that is 848 relative to the namespace of another hierarchical URI. 850 relative-URI = [ net-path / abs-path / rel-path ] [ "?" query ] 852 A relative reference beginning with two slash characters is termed a 853 network-path reference, as defined by in Section 3. Such 854 references are rarely used. 856 A relative reference beginning with a single slash character is 857 termed an absolute-path reference, as defined by in 858 Section 3. 860 A relative reference that does not begin with a scheme name or a 861 slash character is termed a relative-path reference. 863 rel-path = rel-segment [ abs-path ] 865 rel-segment = 1*( unreserved / escaped / ";" / 866 "@" / "&" / "=" / "+" / "$" / "," ) 868 Within a relative-path reference, the complete path segments "." and 869 ".." have special meanings: "the current hierarchy level" and "the 870 level above this hierarchy level", respectively. Although this is 871 very similar to their use within Unix-based filesystems to indicate 872 directory levels, these path components are only considered special 873 when resolving a relative-path reference to its absolute form 874 (Section 5.2). 876 Authors should be aware that a path segment which contains a colon 877 character cannot be used as the first segment of a relative URI path 878 (e.g., "this:that"), because it would be mistaken for a scheme name. 879 It is therefore necessary to precede such segments with other 880 segments (e.g., "./this:that") in order for them to be referenced as 881 a relative path. 883 It is not necessary for all URI within a given scheme to be 884 restricted to the syntax, since the hierarchical 885 properties of that syntax are only necessary when a relative URI is 886 used within a particular document. Documents can only make use of a 887 relative URI when their base URI fits within the syntax. 888 It is assumed that any document which contains a relative reference 889 will also have a base URI that obeys the syntax. In other words, a 890 relative URI cannot be used within a document that has an unsuitable 891 base URI. 893 Some URI schemes do not allow a hierarchical syntax matching the 894 syntax, and thus cannot use relative references. 896 5.1 Establishing a Base URI 898 The term "relative URI" implies that there exists some absolute "base 899 URI" against which the relative reference is applied. Indeed, the 900 base URI is necessary to define the semantics of any relative URI 901 reference; without it, a relative reference is meaningless. In order 902 for relative URI to be usable within a document, the base URI of that 903 document must be known to the parser. 905 The base URI of a document can be established in one of four ways, 906 listed below in order of precedence. The order of precedence can be 907 thought of in terms of layers, where the innermost defined base URI 908 has the highest precedence. This can be visualized graphically as: 910 .----------------------------------------------------------. 911 | .----------------------------------------------------. | 912 | | .----------------------------------------------. | | 913 | | | .----------------------------------------. | | | 914 | | | | .----------------------------------. | | | | 915 | | | | | | | | | | 916 | | | | `----------------------------------' | | | | 917 | | | | (5.1.1) Base URI embedded in the | | | | 918 | | | | document's content | | | | 919 | | | `----------------------------------------' | | | 920 | | | (5.1.2) Base URI of the encapsulating entity | | | 921 | | | (message, document, or none). | | | 922 | | `----------------------------------------------' | | 923 | | (5.1.3) URI used to retrieve the entity | | 924 | `----------------------------------------------------' | 925 | (5.1.4) Default Base URI is application-dependent | 926 `----------------------------------------------------------' 928 5.1.1 Base URI within Document Content 930 Within certain document media types, the base URI of the document can 931 be embedded within the content itself such that it can be readily 932 obtained by a parser. This can be useful for descriptive documents, 933 such as tables of content, which may be transmitted to others through 934 protocols other than their usual retrieval context (e.g., E-Mail or 935 USENET news). 937 It is beyond the scope of this document to specify how, for each 938 media type, the base URI can be embedded. It is assumed that user 939 agents manipulating such media types will be able to obtain the 940 appropriate syntax from that media type's specification. An example 941 of how the base URI can be embedded in the Hypertext Markup Language 942 (HTML) [RFC1866] is provided in Appendix D. 944 A mechanism for embedding the base URI within MIME container types 945 (e.g., the message and multipart types) is defined by MHTML 946 [RFC2110]. Protocols that do not use the MIME message header syntax, 947 but which do allow some form of tagged metainformation to be included 948 within messages, may define their own syntax for defining the base 949 URI as part of a message. 951 5.1.2 Base URI from the Encapsulating Entity 953 If no base URI is embedded, the base URI of a document is defined by 954 the document's retrieval context. For a document that is enclosed 955 within another entity (such as a message or another document), the 956 retrieval context is that entity; thus, the default base URI of the 957 document is the base URI of the entity in which the document is 958 encapsulated. 960 5.1.3 Base URI from the Retrieval URI 962 If no base URI is embedded and the document is not encapsulated 963 within some other entity (e.g., the top level of a composite entity), 964 then, if a URI was used to retrieve the base document, that URI shall 965 be considered the base URI. Note that if the retrieval was the 966 result of a redirected request, the last URI used (i.e., that which 967 resulted in the actual retrieval of the document) is the base URI. 969 5.1.4 Default Base URI 971 If none of the conditions described in Sections 5.1.1--5.1.3 apply, 972 then the base URI is defined by the context of the application. 973 Since this definition is necessarily application-dependent, failing 974 to define the base URI using one of the other methods may result in 975 the same content being interpreted differently by different types of 976 application. 978 It is the responsibility of the distributor(s) of a document 979 containing a relative URI to ensure that the base URI for that 980 document can be established. It must be emphasized that a relative 981 URI cannot be used reliably in situations where the document's base 982 URI is not well-defined. 984 5.2 Resolving Relative References to Absolute Form 986 This section describes an example algorithm for resolving URI 987 references that might be relative to a given base URI. The algorithm 988 is intended to provide a definitive result that can be used to test 989 the output of other implementations. Implementation of the algorithm 990 itself is not required, but the result given by an implementation 991 must match the result that would be given by this algorithm. 993 The base URI is established according to the rules of Section 5.1 and 994 parsed into the four main components as described in Section 3. Note 995 that only the scheme component is required to be present in the base 996 URI; the other components may be empty or undefined. A component is 997 undefined if its preceding separator does not appear in the URI 998 reference; the path component is never undefined, though it may be 999 empty. The base URI's query component is not used by the resolution 1000 algorithm and may be discarded. 1002 For each URI reference (R), the following pseudocode describes an 1003 algorithm for transforming R into its target (T), which is either an 1004 absolute URI or the current document, and R's optional fragment: 1006 (R.scheme, R.authority, R.path, R.query, fragment) = parse(R); 1007 -- The URI reference is parsed into the four components and 1008 -- fragment identifier, as described in Section 4.3. 1010 if ((not validating) and (R.scheme == Base.scheme)) then 1011 -- A non-validating parser may ignore a scheme in the 1012 -- reference if it is identical to the base URI's scheme. 1013 undefine(R.scheme); 1014 endif; 1016 if defined(R.scheme) then 1017 T.scheme = R.scheme; 1018 T.authority = R.authority; 1019 T.path = R.path; 1020 T.query = R.query; 1021 else 1022 if defined(R.authority) then 1023 T.authority = R.authority; 1024 T.path = R.path; 1025 T.query = R.query; 1026 else 1027 if (R.path == "") then 1028 if defined(R.query) then 1029 T.path = Base.path; 1030 T.query = R.query; 1031 else 1032 -- An empty reference refers to the current document 1033 return (current-document, fragment); 1034 endif; 1035 else 1036 if (R.path starts-with "/") then 1037 T.path = R.path; 1038 else 1039 T.path = merge(Base.path, R.path); 1040 endif; 1041 T.query = R.query; 1042 endif; 1043 T.authority = Base.authority; 1044 endif; 1045 T.scheme = Base.scheme; 1046 endif; 1048 return (T, fragment); 1050 The pseudocode above refers to a merge routine for merging a 1051 relative-path reference with the path of the base URI to obtain the 1052 target path. Although there are many ways to do this, we will 1053 describe a simple method using a separate string buffer: 1055 1. All but the last segment of the base URI's path component is 1056 copied to the buffer. In other words, any characters after the 1057 last (right-most) slash character, if any, are excluded. If the 1058 base URI's path component is the empty string, then a single 1059 slash character ("/") is copied to the buffer. 1061 2. The reference's path component is appended to the buffer string. 1063 3. All occurrences of "./", where "." is a complete path segment, 1064 are removed from the buffer string. 1066 4. If the buffer string ends with "." as a complete path segment, 1067 that "." is removed. 1069 5. All occurrences of "/../", where is a complete 1070 path segment not equal to "..", are removed from the buffer 1071 string. Removal of these path segments is performed iteratively, 1072 removing the leftmost matching pattern on each iteration, until 1073 no matching pattern remains. 1075 6. If the buffer string ends with "/..", where is 1076 a complete path segment not equal to "..", that "/.." is 1077 removed. 1079 7. If the resulting buffer string still begins with one or more 1080 complete path segments of "..", then the reference is considered 1081 to be in error. Implementations may handle this error by 1082 retaining these components in the resolved path (i.e., treating 1083 them as part of the final URI), by removing them from the 1084 resolved path (i.e., discarding relative levels above the root), 1085 or by avoiding traversal of the reference. 1087 8. The remaining buffer string is the target URI's path component. 1089 Some systems may find it more efficient to implement the merge 1090 algorithm as a pair of path segment stacks being merged, rather than 1091 as a series of string pattern replacements. 1093 Note: Some WWW client applications will fail to separate the 1094 reference's query component from its path component before merging 1095 the base and reference paths. This may result in a loss of 1096 information if the query component contains the strings "/../" or 1097 "/./". 1099 The resulting target URI components and fragment can be recombined to 1100 provide the absolute form of the URI reference. Using pseudocode, 1101 this would be: 1103 result = "" 1105 if defined(T.scheme) then 1106 append T.scheme to result; 1107 append ":" to result; 1108 endif; 1110 if defined(T.authority) then 1111 append "//" to result; 1112 append T.authority to result; 1113 endif; 1115 append T.path to result; 1117 if defined(T.query) then 1118 append "?" to result; 1119 append T.query to result; 1120 endif; 1122 if defined(fragment) then 1123 append "#" to result; 1124 append fragment to result; 1125 endif; 1127 return result; 1129 Note that we must be careful to preserve the distinction between a 1130 component that is undefined, meaning that its separator was not 1131 present in the reference, and a component that is empty, meaning that 1132 the separator was present and was immediately followed by the next 1133 component separator or the end of the reference. 1135 Resolution examples are provided in Appendix C. 1137 6. URI Normalization and Equivalence 1139 In many cases, different URI strings may actually identify the 1140 identical resource. For example, the host names used in URI are 1141 actually case insensitive, and the URI is 1142 equivalent to . In general, the rules for 1143 equivalence and definition of a normal form, if any, are scheme 1144 dependent. When a scheme uses elements of the common syntax, it will 1145 also use the common syntax equivalence rules, namely that the scheme 1146 and hostname are case insensitive and a URI with an explicit ":port", 1147 where the port is the default for the scheme, is equivalent to one 1148 where the port is elided. 1150 7. Security Considerations 1152 A URI does not in itself pose a security threat. Users should beware 1153 that there is no general guarantee that a URI, which at one time 1154 located a given resource, will continue to do so. Nor is there any 1155 guarantee that a URI will not locate a different resource at some 1156 later point in time, due to the lack of any constraint on how a given 1157 authority apportions its namespace. Such a guarantee can only be 1158 obtained from the person(s) controlling that namespace and the 1159 resource in question. A specific URI scheme may include additional 1160 semantics, such as name persistence, if those semantics are required 1161 of all naming authorities for that scheme. 1163 It is sometimes possible to construct a URI such that an attempt to 1164 perform a seemingly harmless, idempotent operation, such as the 1165 retrieval of an entity associated with the resource, will in fact 1166 cause a possibly damaging remote operation to occur. The unsafe URI 1167 is typically constructed by specifying a port number other than that 1168 reserved for the network protocol in question. The client 1169 unwittingly contacts a site that is in fact running a different 1170 protocol. The content of the URI contains instructions that, when 1171 interpreted according to this other protocol, cause an unexpected 1172 operation. An example has been the use of a gopher URI to cause an 1173 unintended or impersonating message to be sent via a SMTP server. 1175 Caution should be used when using any URI that specifies a port 1176 number other than the default for the protocol, especially when it is 1177 a number within the reserved space. 1179 Care should be taken when a URI contains escaped delimiters for a 1180 given protocol (for example, CR and LF characters for telnet 1181 protocols) that these are not unescaped before transmission. This 1182 might violate the protocol, but avoids the potential for such 1183 characters to be used to simulate an extra operation or parameter in 1184 that protocol, which might lead to an unexpected and possibly harmful 1185 remote operation to be performed. 1187 It is clearly unwise to use a URI that contains a password which is 1188 intended to be secret. In particular, the use of a password within 1189 the 'userinfo' component of a URI is strongly discouraged except 1190 in those rare cases where the 'password' parameter is intended to be 1191 public. 1193 8. Acknowledgements 1195 This document is derived from RFC 2396 [RFC2396], RFC 1808 [RFC1808], 1196 and RFC 1738 [RFC1738]; the acknowledgements in those specifications 1197 still apply. It also incorporates the update (with corrections) for 1198 IPv6 literals in the host syntax, as defined by Robert M. Hinden, 1199 Brian E. Carpenter, and Larry Masinter in [RFC2732]. In addition, 1200 contributions by Reese Anschultz, Tim Bray, Dan Connolly, Adam M. 1201 Costello, Jason Diamond, Martin Duerst, Henry Holtzman, Bruce Lilly, 1202 Michael Mealling, Julian Reschke, Miles Sabin, Ronald Tschalaer, Marc 1203 Warne, and Henry Zongaro are gratefully acknowledged. 1205 Normative References 1207 [ASCII] American National Standards Institute, "Coded Character 1208 Set -- 7-bit American Standard Code for Information 1209 Interchange", ANSI X3.4, 1986. 1211 [RFC1123] Braden, R., "Requirements for Internet Hosts - Application 1212 and Support", STD 3, RFC 1123, October 1989. 1214 [RFC2234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 1215 Specifications: ABNF", RFC 2234, November 1997. 1217 [RFC0952] Harrenstien, K., Stahl, M. and E. Feinler, "DoD Internet 1218 host table specification", RFC 952, October 1985. 1220 [RFC2373] Hinden, R. and S. Deering, "IP Version 6 Addressing 1221 Architecture", RFC 2373, July 1998. 1223 [RFC1034] Mockapetris, P., "Domain names - concepts and facilities", 1224 STD 13, RFC 1034, November 1987. 1226 [UTF-8] Yergeau, F., "UTF-8, a transformation format of ISO 1227 10646", RFC 2279, January 1998. 1229 Non-normative References 1231 [RFC2277] Alvestrand, H., "IETF Policy on Character Sets and 1232 Languages", BCP 18, RFC 2277, January 1998. 1234 [RFC1630] Berners-Lee, T., "Universal Resource Identifiers in WWW: A 1235 Unifying Syntax for the Expression of Names and Addresses 1236 of Objects on the Network as used in the World-Wide Web", 1237 RFC 1630, June 1994. 1239 [RFC1738] Berners-Lee, T., Masinter, L. and M. McCahill, "Uniform 1240 Resource Locators (URL)", RFC 1738, December 1994. 1242 [RFC1866] Berners-Lee, T. and D. Connolly, "Hypertext Markup 1243 Language - 2.0", RFC 1866, November 1995. 1245 [RFC2396] Berners-Lee, T., Fielding, R. and L. Masinter, "Uniform 1246 Resource Identifiers (URI): Generic Syntax", RFC 2396, 1247 August 1998. 1249 [RFC1808] Fielding, R., "Relative Uniform Resource Locators", RFC 1250 1808, June 1995. 1252 [RFC2046] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 1253 Extensions (MIME) Part Two: Media Types", RFC 2046, 1254 November 1996. 1256 [RFC2518] Goland, Y., Whitehead, E., Faizi, A., Carter, S. and D. 1257 Jensen, "HTTP Extensions for Distributed Authoring -- 1258 WEBDAV", RFC 2518, February 1999. 1260 [RFC2732] Hinden, R., Carpenter, B. and L. Masinter, "Format for 1261 Literal IPv6 Addresses in URL's", RFC 2732, December 1999. 1263 [RFC1736] Kunze, J., "Functional Recommendations for Internet 1264 Resource Locators", RFC 1736, February 1995. 1266 [RFC1737] Masinter, L. and K. Sollins, "Functional Requirements for 1267 Uniform Resource Names", RFC 1737, December 1994. 1269 [RFC2110] Palme, J. and A. Hopmann, "MIME E-mail Encapsulation of 1270 Aggregate Documents, such as HTML (MHTML)", RFC 2110, 1271 March 1997. 1273 [RFC2717] Petke, R. and I. King, "Registration Procedures for URL 1274 Scheme Names", BCP 35, RFC 2717, November 1999. 1276 Authors' Addresses 1278 Tim Berners-Lee 1279 World Wide Web Consortium 1280 MIT/LCS, Room NE43-356 1281 200 Technology Square 1282 Cambridge, MA 02139 1283 USA 1285 Phone: +1-617-253-5702 1286 Fax: +1-617-258-5999 1287 EMail: timbl@w3.org 1288 URI: http://www.w3.org/People/Berners-Lee/ 1290 Roy T. Fielding 1291 Day Software 1292 2 Corporate Plaza, Suite 150 1293 Newport Beach, CA 92660 1294 USA 1296 Phone: +1-949-644-2557 1297 Fax: +1-949-644-5064 1298 EMail: roy.fielding@day.com 1299 URI: http://www.apache.org/~fielding/ 1301 Larry Masinter 1302 Adobe Systems Incorporated 1303 345 Park Ave 1304 San Jose, CA 95110 1305 USA 1307 Phone: +1-408-536-3024 1308 EMail: LMM@acm.org 1309 URI: http://larry.masinter.net/ 1311 Appendix A. Collected BNF for URI 1313 absolute-URI-reference = absolute-URI [ "#" fragment ] 1315 URI-reference = [ absolute-URI / relative-URI ] [ "#" fragment ] 1316 absolute-URI = scheme ":" ( hier-part / opaque-part ) 1317 relative-URI = [ net-path / abs-path / rel-path ] [ "?" query ] 1319 hier-part = [ net-path / abs-path ] [ "?" query ] 1320 opaque-part = uric-no-slash *uric 1322 uric-no-slash = unreserved / escaped / "[" / "]" / ";" / "?" / 1323 ":" / "@" / "&" / "=" / "+" / "$" / "," 1325 net-path = "//" authority [ abs-path ] 1326 abs-path = "/" path-segments 1327 rel-path = rel-segment [ abs-path ] 1329 rel-segment = 1*( unreserved / escaped / ";" / 1330 "@" / "&" / "=" / "+" / "$" / "," ) 1332 scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) 1334 authority = server / reg-name 1336 reg-name = 1*( unreserved / escaped / ";" / 1337 ":" / "@" / "&" / "=" / "+" / "$" / "," ) 1339 server = [ [ userinfo "@" ] hostport ] 1340 userinfo = *( unreserved / escaped / ";" / 1341 ":" / "&" / "=" / "+" / "$" / "," ) 1343 hostport = host [ ":" port ] 1344 host = IPv6reference / IPv4address / hostname 1345 port = *DIGIT 1347 hostname = domainlabel [ qualified ] 1348 qualified = *( "." domainlabel ) [ "." toplabel [ "." ] ] 1349 domainlabel = alphanum [ 0*61( alphanum | "-" ) alphanum ] 1350 toplabel = alpha [ 0*61( alphanum | "-" ) alphanum ] 1351 alphanum = ALPHA / DIGIT 1353 IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet 1354 dec-octet = DIGIT / ; 0-9 1355 ( %x31-39 DIGIT ) / ; 10-99 1356 ( "1" 2*DIGIT ) / ; 100-199 1357 ( "2" %x30-34 DIGIT ) / ; 200-249 1358 ( "25" %x30-35 ) ; 250-255 1360 IPv6reference = "[" IPv6address "]" 1361 IPv6address = ( 7( h4 ":" ) h4 ) / 1362 ( "::" 0*6( h4 ":" ) [ h4 ] ) / 1363 ( h4 "::" 0*5( h4 ":" ) [ h4 ] ) / 1364 ( h4 ":" h4 "::" 0*4( h4 ":" ) [ h4 ] ) / 1365 ( h4 2( ":" h4 ) "::" 0*3( h4 ":" ) [ h4 ] ) / 1366 ( h4 3( ":" h4 ) "::" 0*2( h4 ":" ) [ h4 ] ) / 1367 ( h4 4( ":" h4 ) "::" 0*1( h4 ":" ) [ h4 ] ) / 1368 ( 6( h4 ":" ) IPv4address ) / 1369 ( "::" 0*5( h4 ":" ) IPv4address ) / 1370 ( h4 "::" 0*4( h4 ":" ) IPv4address ) / 1371 ( h4 ":" h4 "::" 0*3( h4 ":" ) IPv4address ) / 1372 ( h4 2( ":" h4 ) "::" 0*2( h4 ":" ) IPv4address ) / 1373 ( h4 3( ":" h4 ) "::" 0*1( h4 ":" ) IPv4address ) 1375 h4 = 1*4HEXDIG 1377 path = [ abs-path / opaque-part ] 1378 path-segments = segment *( "/" segment ) 1379 segment = *pchar 1381 pchar = unreserved / escaped / ";" / 1382 ":" / "@" / "&" / "=" / "+" / "$" / "," 1384 query = *( pchar / "/" / "?" ) 1385 fragment = *( pchar / "/" / "?" ) 1387 uric = reserved / unreserved / escaped 1388 reserved = "[" / "]" / ";" / "/" / "?" / 1389 ":" / "@" / "&" / "=" / "+" / "$" / "," 1390 unreserved = ALPHA / DIGIT / mark 1391 mark = "-" / "_" / "." / "!" / "~" / "*" / "'" / 1392 "(" / ")" 1394 escaped = "%" HEXDIG HEXDIG 1396 Appendix B. Parsing a URI Reference with a Regular Expression 1398 As described in Section 4.3, the generic URI syntax is not sufficient 1399 to disambiguate the components of some forms of URI. Since the 1400 "greedy algorithm" described in that section is identical to the 1401 disambiguation method used by POSIX regular expressions, it is 1402 natural and commonplace to use a regular expression for parsing the 1403 potential four components and fragment identifier of a URI reference. 1405 The following line is the regular expression for breaking-down a URI 1406 reference into its components. 1408 ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))? 1409 12 3 4 5 6 7 8 9 1411 The numbers in the second line above are only to assist readability; 1412 they indicate the reference points for each subexpression (i.e., each 1413 paired parenthesis). We refer to the value matched for subexpression 1414 as $. For example, matching the above expression to 1416 http://www.ics.uci.edu/pub/ietf/uri/#Related 1418 results in the following subexpression matches: 1420 $1 = http: 1421 $2 = http 1422 $3 = //www.ics.uci.edu 1423 $4 = www.ics.uci.edu 1424 $5 = /pub/ietf/uri/ 1425 $6 = 1426 $7 = 1427 $8 = #Related 1428 $9 = Related 1430 where indicates that the component is not present, as is 1431 the case for the query component in the above example. Therefore, we 1432 can determine the value of the four components and fragment as 1434 scheme = $2 1435 authority = $4 1436 path = $5 1437 query = $7 1438 fragment = $9 1440 and, going in the opposite direction, we can recreate a URI reference 1441 from its components using the algorithm of Section 5.2. 1443 Appendix C. Examples of Resolving Relative URI References 1445 Within an object with a well-defined base URI of 1447 http://a/b/c/d;p?q 1449 the relative URI would be resolved as follows: 1451 C.1 Normal Examples 1453 g:h = g:h 1454 g = http://a/b/c/g 1455 ./g = http://a/b/c/g 1456 g/ = http://a/b/c/g/ 1457 /g = http://a/g 1458 //g = http://g 1459 ?y = http://a/b/c/d;p?y 1460 g?y = http://a/b/c/g?y 1461 #s = (current document)#s 1462 g#s = http://a/b/c/g#s 1463 g?y#s = http://a/b/c/g?y#s 1464 ;x = http://a/b/c/;x 1465 g;x = http://a/b/c/g;x 1466 g;x?y#s = http://a/b/c/g;x?y#s 1467 . = http://a/b/c/ 1468 ./ = http://a/b/c/ 1469 .. = http://a/b/ 1470 ../ = http://a/b/ 1471 ../g = http://a/b/g 1472 ../.. = http://a/ 1473 ../../ = http://a/ 1474 ../../g = http://a/g 1476 C.2 Abnormal Examples 1478 Although the following abnormal examples are unlikely to occur in 1479 normal practice, all URI parsers should be capable of resolving them 1480 consistently. Each example uses the same base as above. 1482 An empty reference refers to the start of the current document. 1484 <> = (current document) 1486 Parsers must be careful in handling the case where there are more 1487 relative path ".." segments than there are hierarchical levels in the 1488 base URI's path. Note that the ".." syntax cannot be used to change 1489 the authority component of a URI. 1491 ../../../g = http://a/../g 1492 ../../../../g = http://a/../../g 1494 In practice, some implementations strip leading relative symbolic 1495 elements (".", "..") after applying a relative URI calculation, based 1496 on the theory that compensating for obvious author errors is better 1497 than allowing the request to fail. Thus, the above two references 1498 will be interpreted as "http://a/g" by some implementations. 1500 Similarly, parsers must avoid treating "." and ".." as special when 1501 they are not complete components of a relative path. 1503 /./g = http://a/./g 1504 /../g = http://a/../g 1505 g. = http://a/b/c/g. 1506 .g = http://a/b/c/.g 1507 g.. = http://a/b/c/g.. 1508 ..g = http://a/b/c/..g 1510 Less likely are cases where the relative URI uses unnecessary or 1511 nonsensical forms of the "." and ".." complete path segments. 1513 ./../g = http://a/b/g 1514 ./g/. = http://a/b/c/g/ 1515 g/./h = http://a/b/c/g/h 1516 g/../h = http://a/b/c/h 1517 g;x=1/./y = http://a/b/c/g;x=1/y 1518 g;x=1/../y = http://a/b/c/y 1520 Some applications fail to separate the reference's query and/or 1521 fragment components from a relative path before merging it with the 1522 base path. This error is rarely noticed, since typical usage of a 1523 fragment never includes the hierarchy ("/") character, and the query 1524 component is not normally used within relative references. 1526 g?y/./x = http://a/b/c/g?y/./x 1527 g?y/../x = http://a/b/c/g?y/../x 1528 g#s/./x = http://a/b/c/g#s/./x 1529 g#s/../x = http://a/b/c/g#s/../x 1531 Some parsers allow the scheme name to be present in a relative URI if 1532 it is the same as the base URI scheme. This is considered to be a 1533 loophole in prior specifications of partial URI [RFC1630]. Its use 1534 should be avoided, but is allowed for backwards compatibility. 1536 http:g = http:g ; for validating parsers 1537 / http://a/b/c/g ; for backwards compatibility 1539 Appendix D. Embedding the Base URI in HTML documents 1541 It is useful to consider an example of how the base URI of a document 1542 can be embedded within the document's content. In this appendix, we 1543 describe how documents written in the Hypertext Markup Language 1544 (HTML) [RFC1866] can include an embedded base URI. This appendix 1545 does not form a part of the URI specification and should not be 1546 considered as anything more than a descriptive example. 1548 HTML defines a special element "BASE" which, when present in the 1549 "HEAD" portion of a document, signals that the parser should use the 1550 BASE element's "HREF" attribute as the base URI for resolving any 1551 relative URI. The "HREF" attribute must be an absolute URI. Note 1552 that, in HTML, element and attribute names are case-insensitive. For 1553 example: 1555 1556 1557 An example HTML document 1558 1559 1560 ... a hypertext anchor ... 1561 1563 A parser reading the example document should interpret the given 1564 relative URI "../x" as representing the absolute URI 1566 1568 regardless of the context in which the example document was obtained. 1570 Appendix E. Recommendations for Delimiting URI in Context 1572 URIs are often transmitted through formats that do not provide a 1573 clear context for their interpretation. For example, there are many 1574 occasions when a URI is included in plain text; examples include text 1575 sent in electronic mail, USENET news messages, and, most importantly, 1576 printed on paper. In such cases, it is important to be able to 1577 delimit the URI from the rest of the text, and in particular from 1578 punctuation marks that might be mistaken for part of the URI. 1580 In practice, URI are delimited in a variety of ways, but usually 1581 within double-quotes "http://example.com/", angle brackets , or just using whitespace 1584 http://example.com/ 1586 These wrappers do not form part of the URI. 1588 In the case where a fragment identifier is associated with a URI 1589 reference, the fragment would be placed within the brackets as well 1590 (separated from the URI with a "#" character). 1592 In some cases, extra whitespace (spaces, linebreaks, tabs, etc.) may 1593 need to be added to break a long URI across lines. The whitespace 1594 should be ignored when extracting the URI. 1596 No whitespace should be introduced after a hyphen ("-") character. 1597 Because some typesetters and printers may (erroneously) introduce a 1598 hyphen at the end of line when breaking a line, the interpreter of a 1599 URI containing a line break immediately after a hyphen should ignore 1600 all unescaped whitespace around the line break, and should be aware 1601 that the hyphen may or may not actually be part of the URI. 1603 Using <> angle brackets around each URI is especially recommended as 1604 a delimiting style for a URI that contains whitespace. 1606 The prefix "URL:" (with or without a trailing space) was formerly 1607 recommended as a way to help distinguish a URI from other bracketed 1608 designators, though it is not commonly used in practice and is no 1609 longer recommended. 1611 For robustness, software that accepts user-typed URI should attempt 1612 to recognize and strip both delimiters and embedded whitespace. 1614 For example, the text: 1616 Yes, Jim, I found it under "http://www.w3.org/Addressing/", 1617 but you can probably pick it up from . Note the warning in . 1621 contains the URI references 1623 http://www.w3.org/Addressing/ 1624 ftp://ds.internic.net/rfc/ 1625 http://www.ics.uci.edu/pub/ietf/uri/historical.html#WARNING 1627 Appendix F. Abbreviated URIs 1629 The URI syntax was designed for unambiguous reference to network 1630 resources and extensibility via the URI scheme. However, as URI 1631 identification and usage have become commonplace, traditional media 1632 (television, radio, newspapers, billboards, etc.) have increasingly 1633 used abbreviated URI references. That is, a reference consisting of 1634 only the authority and path portions of the identified resource, such 1635 as 1637 www.w3.org/Addressing/ 1639 or simply the DNS hostname on its own. Such references are primarily 1640 intended for human interpretation rather than machine, with the 1641 assumption that context-based heuristics are sufficient to complete 1642 the URI (e.g., most hostnames beginning with "www" are likely to have 1643 a URI prefix of "http://"). Although there is no standard set of 1644 heuristics for disambiguating abbreviated URI references, many client 1645 implementations allow them to be entered by the user and 1646 heuristically resolved. It should be noted that such heuristics may 1647 change over time, particularly when new URI schemes are introduced. 1649 Since an abbreviated URI has the same syntax as a relative URI path, 1650 abbreviated URI references cannot be used in contexts where relative 1651 URIs are expected. This limits the use of abbreviated URIs to places 1652 where there is no defined base URI, such as dialog boxes and off-line 1653 advertisements. 1655 Appendix G. Summary of Non-editorial Changes 1657 G.1 Additions 1659 IPv6 literals have been added to the list of possible identifiers for 1660 the host portion of a server component, as described by [RFC2732], 1661 with the addition of "[" and "]" to the reserved, uric, and uric-no- 1662 slash sets. Square brackets are now specified as reserved for the 1663 authority component, allowed within the opaque part of an opaque URI, 1664 and not allowed in the hierarchical syntax except for their use as 1665 delimiters for an IPv6reference within host. In order to make this 1666 change without changing the technical definition of the path, query, 1667 and fragment components, those rules were redefined to directly 1668 specify the characters allowed rather than continuing to be defined 1669 in terms of uric. 1671 Since [RFC2732] defers to [RFC2373] for definition of an IPv6 literal 1672 address, which unfortunately has an incorrect ABNF description of 1673 IPv6address, we created a new ABNF rule for IPv6address that matches 1674 the text representations defined by Section 2.2 of [RFC2373]. 1675 Likewise, the definition of IPv4address has been improved in order to 1676 limit each decimal octet to the range 0-255, and the definition of 1677 hostname has been improved to better specify length limitations and 1678 partially-qualified domain names. 1680 G.2 Modifications from RFC 2396 1682 The ad-hoc BNF syntax has been replaced with the ABNF of [RFC2234]. 1683 This change required all rule names that formerly included underscore 1684 characters to be renamed with a dash instead. Likewise, absoluteURI 1685 and relativeURI have been changed to absolute-URI and relative-URI, 1686 respectively, for consistency. 1688 The ABNF of hier-part and relative-URI (Section 3) has been corrected 1689 to allow a relative URI path to be empty. This also allows an 1690 absolute-URI to consist of nothing after the "scheme:", as is present 1691 in practice with the "DAV:" namespace [RFC2518] and the "about:" URI 1692 used by many browser implementations. 1694 The resolving relative references algorithm of [RFC2396] has been 1695 rewritten using pseudocode for this revision to improve clarity and 1696 fix the following issues: 1698 o [RFC2396] section 5.2, step 6a, failed to account for a base URI 1699 with no path. 1701 o Restored the behavior of [RFC1808] where, if the the reference 1702 contains an empty path and a defined query component, then the 1703 target URI inherits the base URI's path component. 1705 Index 1707 A 1708 abs-path 13 1709 absolute-URI 13 1710 absolute-URI-reference 19 1711 alphanum 16 1712 authority 14 1714 D 1715 dec-octet 16 1716 delims 12 1717 domainlabel 16 1719 E 1720 escaped 11 1722 F 1723 fragment 19 1725 H 1726 h4 17 1727 hier-part 13 1728 host 15 1729 hostname 16 1730 hostport 15 1732 I 1733 IPv4 16 1734 IPv4address 16 1735 IPv6 17 1736 IPv6address 17 1737 IPv6reference 17 1739 M 1740 mark 11 1742 N 1743 net-path 13 1745 O 1746 opaque-part 13 1748 P 1749 path 17 1750 path-segments 17 1751 pchar 17 1752 port 15 1754 Q 1755 qualified 16 1756 query 18 1758 R 1759 reg-name 15 1760 rel-path 21 1761 rel-segment 21 1762 relative-URI 21 1763 reserved 10 1765 S 1766 scheme 14 1767 segment 17 1768 server 15 1770 T 1771 toplabel 16 1773 U 1774 unreserved 11 1775 unwise 12 1776 URI grammar 1777 abs-path 13 1778 absolute-URI 13 1779 absolute-URI-reference 19 1780 alphanum 16 1781 authority 14 1782 dec-octet 16 1783 delims 12 1784 domainlabel 16 1785 escaped 11 1786 fragment 19 1787 h4 17 1788 hier-part 13 1789 host 16 1790 hostname 16 1791 hostport 16 1792 IPv4address 16 1793 IPv6address 17 1794 IPv6reference 17 1795 mark 11 1796 net-path 13 1797 opaque-part 13 1798 path 17 1799 path-segments 17 1800 pchar 17 1801 port 16 1802 qualified 16 1803 query 18 1804 reg-name 15 1805 rel-path 21 1806 rel-segment 21 1807 relative-URI 21 1808 reserved 10 1809 scheme 14 1810 segment 17 1811 server 15 1812 toplabel 16 1813 unreserved 11 1814 unwise 12 1815 URI-reference 19 1816 uric 9 1817 uric-no-slash 13 1818 userinfo 15 1819 URI-reference 19 1820 uric 9 1821 uric-no-slash 13 1822 userinfo 15 1824 Full Copyright Statement 1826 Copyright (C) The Internet Society (2002). All Rights Reserved. 1828 This document and translations of it may be copied and furnished to 1829 others, and derivative works that comment on or otherwise explain it 1830 or assist in its implementation may be prepared, copied, published 1831 and distributed, in whole or in part, without restriction of any 1832 kind, provided that the above copyright notice and this paragraph are 1833 included on all such copies and derivative works. However, this 1834 document itself may not be modified in any way, such as by removing 1835 the copyright notice or references to the Internet Society or other 1836 Internet organizations, except as needed for the purpose of 1837 developing Internet standards in which case the procedures for 1838 copyrights defined in the Internet Standards process must be 1839 followed, or as required to translate it into languages other than 1840 English. 1842 The limited permissions granted above are perpetual and will not be 1843 revoked by the Internet Society or its successors or assigns. 1845 This document and the information contained herein is provided on an 1846 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING 1847 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING 1848 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION 1849 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF 1850 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 1852 Acknowledgement 1854 Funding for the RFC Editor function is currently provided by the 1855 Internet Society.