rfc2774.An HTTP Extension Framework

合集下载

2024年《工业网络安全应用项目实践》期末考试题库及答案

2024年《工业网络安全应用项目实践》期末考试题库及答案

D、告警 参考答案:B 8.SMTP 定义了计算机如何将邮件发送到 A、SMTPServer B、SMTPClient C、POP3Server D、POP3Client 参考答案:A 9.以下哪项不是 WLAN 用户接入安全技术范畴 A、链路认证
B、隧道技术 C、用户接入认证 D、数据加密 参考答案:B 10.HTTP 行为控制技术的控制项不包括 A、文件删除 B、POST 操作 C、浏览网页 D、代理上网 参考答案:A 11.防火墙主要组网应用场景不包括 A、企业内路由计算
参考答案:A 14.云平台安全解决方案架构不包括 A、基础设施安全 B、租户服务安全 C、组织结构安全 D、运维管理安全 参考答案:C
15. 计算机病毒按照感染对象分类不包括 A、操作系统 B、应用程序 C、带宽
D、设备 参考答案:C 16.访问控制攻击不包括 A、驾驶攻击
B、非法 AP C、AdHoc 关联攻击 D、拒绝服务攻击 参考答案:D 17.下列基于用户组的用户隔离不包括 A、组间用户隔离
B、阻断 C、放行 D、按权重操作 参考答案:C 30.以下哪项不是 WPI 的优势 A、双向身份鉴别 B、数字证书身份凭证 C、可靠的数据加密 D、完善的鉴别协议 参考答案:C 31.防火墙支持基于 VLAN 分流方式其接口工作在 A、五层 B、四层 C、三层 D、二层
参考答案:D 32.文件类型识别结果异常情况不包括 A、文件扩展名不匹配 B、文件类型无法识别 C、文件修改 D、文件损坏 参考答案:C
B、企业内网管控&隔离 C、数据中心隔离 D、互联网边界防护 参考答案:A 12.防火墙系统日志的类型不包括 A、告警 B、登录 C、操作 D、黑名单 参考答案:C 13.下列 SMURF 攻击防范防范配置正确的为 A、firewalldefendsmurfenable

Apache的工作原理

Apache的工作原理

Apache的工作原理Apache是一个开源的跨平台的Web服务器软件,它是目前最流行的Web服务器之一。

Apache的工作原理涉及到网络通信、请求处理、模块化架构等多个方面。

下面将详细介绍Apache的工作原理。

1. 网络通信Apache通过网络与客户端进行通信,客户端可以是浏览器、挪移应用或者其他Web服务器。

通信使用HTTP协议,客户端发送HTTP请求给Apache服务器,Apache服务器接收请求并返回HTTP响应。

2. 请求处理当Apache接收到客户端的HTTP请求后,它会进行一系列的处理来处理该请求。

首先,Apache会解析请求头部,获取请求的方法(如GET、POST)、URL、协议版本等信息。

然后,Apache会根据URL找到对应的虚拟主机配置,确定请求应该由哪个虚拟主机处理。

3. 虚拟主机Apache支持虚拟主机,一个物理服务器上可以运行多个虚拟主机,每一个虚拟主机有自己的域名和配置。

当Apache确定请求应该由哪个虚拟主机处理后,它会加载该虚拟主机的配置文件,并按照配置文件中的设置来处理请求。

4. 模块化架构Apache的核心功能通过模块来实现,它的模块化架构使得用户可以根据需要选择加载不同的模块。

Apache提供了不少内置的模块,如核心模块、认证模块、日志模块等。

用户还可以自己编写模块来扩展Apache的功能。

5. 静态资源处理当请求的URL对应的是静态资源(如HTML文件、图片、CSS文件等)时,Apache会直接从磁盘上读取该资源并返回给客户端。

Apache会根据配置文件中的设置来确定静态资源的存放位置。

6. 动态资源处理当请求的URL对应的是动态资源(如PHP文件、Java Servlet等)时,Apache会将请求转发给相应的处理程序。

处理程序会生成动态内容,并将结果返回给Apache,然后Apache再将结果返回给客户端。

7. 连接管理Apache负责管理与客户端的连接。

PHP网络协议

PHP网络协议

PHP⽹络协议HTTP状态码HTTP状态码(HTTP Status Code)是⽤以表⽰⽹页服务器HTTP响应状态的3位数字代码。

HTTP状态码主要有5种,代表5种不同类型的响应:1. 1xx:信息性状态码,代表接收到请求,正在处理2. 2xx:成功状态码,代表请求正常处理完毕1. 200 OK表⽰从客户端发来的请求在服务端被正常处理了2. 204 No Content服务器接收的处理已经全部处理完毕,但是返回的响应报⽂中不含有实体的主体部分,另外也不允许返回任何的主体,浏览器接收到204响应之后页⾯不更新。

3. 206 Partial Content客户端进⾏了范围请求,服务器成功执⾏了这部分的GET请求。

响应报⽂中包含由Content-Range指定的实体内容。

3. 3xx:重定向,表明浏览器需要执⾏某些特殊的处理以正确处理请求。

1. 301 Moved Permanenty永久重定向,301表⽰请求的资源已经被分配了新的URI,以后应使⽤资源现在所指的URI。

2. 302 Found临时重定向,该状态码表⽰请求的资源已被分配了新的URI,希望⽤户(本次)能够使⽤新的URI访问。

与301不同,302是临时重定向,已移动的资源对应的URI在将来可能还是会发⽣改变。

3. 303 See Other表⽰请求对应的资源存在着另⼀个URI,应使⽤GET⽅法定向获取请求的资源。

4. 304 Not Modified304虽然被划分在3xx中,但是和重定向并没有关系。

该状态码表⽰客户端发送附带条件的请求时,服务器允许请求访问资源,但因发⽣请求未满⾜条件的情况后,直接返回304 Not Modified(服务器资源未改变,可直接使⽤客户端未过期的缓存)。

304状态码返回时,不包含任何响应的主体部分。

5. 307 Temporary Redirect临时重定向。

该状态码与302 Found 有着相同的含义。

尽管302标准禁⽌POST变换成GET,但实际使⽤时⼤家并不遵守。

Apache的工作原理

Apache的工作原理

Apache的工作原理Apache是一个开源的、跨平台的Web服务器软件,它是目前世界上最流行的Web服务器之一。

Apache的工作原理涉及到网络通信、请求处理、模块管理等多个方面。

下面将详细介绍Apache的工作原理。

1. 网络通信Apache通过监听一个特定的端口(默认为80)来接收客户端的HTTP请求。

当客户端发送一个HTTP请求到Apache服务器时,Apache会通过网络套接字接收到该请求。

Apache使用TCP/IP协议与客户端进行通信,建立起一个持久的连接。

2. 请求处理一旦Apache接收到客户端的请求,它会对请求进行解析和处理。

首先,Apache会解析HTTP请求头,获取请求的方法(GET、POST等)、URL、协议版本等信息。

然后,Apache会根据URL映射到相应的虚拟主机(Virtual Host)或者目录,并将请求交给相应的处理模块进行处理。

3. 模块管理Apache的核心功能是由一系列模块来实现的,这些模块可以通过配置文件进行加载和管理。

Apache支持静态模块和动态模块。

静态模块是在编译时静态链接到Apache的可执行文件中,而动态模块可以在运行时通过加载器动态加载。

模块可以提供各种功能,如认证、日志记录、缓存、重定向等。

4. 请求处理流程一旦请求被分配到相应的处理模块,Apache会按照一定的处理流程对请求进行处理。

通常,处理流程包括以下几个阶段:- 访问控制阶段:Apache会检查请求的访问权限,根据配置文件中的规则进行访问控制,如IP过滤、基于用户的认证等。

- URL重写阶段:Apache可以根据配置文件中的规则对URL进行重写,将URL映射到实际的文件或者处理程序。

- 资源获取阶段:Apache会根据请求的URL找到对应的文件或者处理程序,并将请求转发给相应的模块进行处理。

- 响应生成阶段:处理模块会根据请求的内容生成响应,包括HTTP响应头和响应体。

Apache会将响应发送给客户端。

AWAF知识点学习

AWAF知识点学习

AWAF知识点学习AWAF知识点Data GuardData Guard是在HTTP响应中防⽌铭感数据泄露的,⽐如在HTTP响应中包含了信⽤卡信息、U.S.Social Security number等,或者是⾃定义的信息。

有两种防护⽅式当Policy是Blocking的时候,如果响应中包含了敏感信息,AWAF会拦截这个响应AWAF也可以对敏感信息进⾏加密,只有在Policy是Transparent或者是Bolcking但是Data Guard是Alarm/Learn的时候才会加密,加密的形式是*,并且需要勾选Mask Data可以使⽤⾃定义的Patterns来本地化定义⾝份证信息或电话号4[0-9]{3}-[0-9]{4}-[0-9]{4}-#表⽰以4开头的前⼗⼆位数为敏感数据,AWAF将对其进⾏隐藏#[]表⽰0-9的数字;{}表⽰数的位数Exception Patterns该选项表⽰指定系统认为那些不是铭感数据File Content Detection指定系统是否检查⽂件内容的响应,如果是,哪些类型的⽂件内容被视为敏感数据。

这可以防⽌服务器将您不希望返回给⽤户的⽂件内容传递给⽤户。

Enforcement Mode⽤于指定Data Guard对那些URL进⾏防护Ignore URLs---Data Guard会防护所有的URL,除了列表中的Enforce URLs---Data Guard会防护列表中的URL,即使该URL并不在Security Policy中AWAF将Cookie分为两种,分别是Allowed和EnforcedAllowed类型的Cookie⼀般是Persistent Cookie、Single Sign On Cookie、或者是其他的合法的Cookie。

当这类Cookie背设置为Allow,AWAF会忽略并不会触发告警;Allowed Cookie可以设置Explicit和Wildcard两种Enforced类型的Cookie是在客户端侧不应该被修改的。

htp协议书

htp协议书

htp协议书HTTP(Hypertext Transfer Protocol)是一种用于传输超文本的应用层协议。

它是互联网的基础之一,用于客户端和服务器之间的通信。

HTTP的主要目标是允许客户端和服务器之间的信息交换,使互联网上的资源能够被访问和共享。

HTTP协议的基本原理是通过客户端向服务器发送请求,服务器将资源返回给客户端。

在HTTP请求中,客户端发送一个由请求行、请求头和请求体组成的请求消息,服务器通过响应消息回应请求,响应消息由响应行、响应头和响应体组成。

HTTP协议是无状态的,这意味着服务器不会保留任何关于客户端状态的信息。

每个请求都是独立的,并且服务器不知道该请求是否与之前的请求有关。

HTTP协议使用统一资源标识符(Uniform Resource Identifier,URI)来标识资源,URI由URL(Uniform Resource Locator)和URN(Uniform Resource Name)组成。

URL用于定位资源,它包含了协议类型、服务器名称(或IP地址)、端口号和资源路径。

URN用于命名资源,它提供了一个持久的、唯一的标识符。

HTTP协议使用不同的方法来执行不同的操作。

常用的方法有GET、POST、PUT、DELETE等。

GET方法用于获取资源,POST方法用于提交数据并创建资源,PUT方法用于更新资源,DELETE方法用于删除资源。

HTTP协议使用状态码来表示请求的处理结果。

常见的状态码有200(成功)、404(资源不存在)、500(服务器内部错误)等。

状态码提供了一种标准的、可扩展的方式,用于客户端和服务器之间的通信。

HTTP协议还支持缓存机制,通过在响应消息中添加缓存控制头信息,可以实现对资源的缓存。

客户端可以根据缓存控制头信息来判断是否需要重新请求资源,从而提高性能和减少带宽消耗。

HTTP协议还支持持续连接,通过在请求头中添加Connection字段,可以告知服务器是否保持连接。

Apache的工作原理

Apache的工作原理

Apache的工作原理Apache是一种常用的开源Web服务器软件,它是基于HTTP协议的,用于响应客户端的HTTP请求并传送相应的Web页面或其他资源。

Apache的工作原理主要包括请求处理、模块化架构和并发处理。

1. 请求处理:当客户端发送一个HTTP请求到Apache服务器时,Apache会按照一定的处理流程进行处理。

首先,Apache会解析请求的URL,获取请求的文件或资源路径。

然后,Apache会根据配置文件中的规则,确定如何处理该请求,包括文件的位置、是否需要进行权限验证等。

2. 模块化架构:Apache采用模块化的架构,这意味着它的功能可以通过加载不同的模块来扩展。

Apache服务器的核心功能由一些基本模块提供,如核心模块、日志模块、认证模块等。

此外,还可以通过加载第三方模块来增加额外的功能,如PHP模块、SSL模块等。

模块化的架构使得Apache具有高度的灵活性和可扩展性,可以根据需求选择加载不同的模块。

3. 并发处理:Apache采用多进程或多线程的方式来处理并发请求。

当有多个请求同时到达时,Apache会创建多个子进程或线程来处理这些请求。

每个子进程或线程独立运行,互不干扰。

这样可以提高服务器的并发处理能力,同时也增加了服务器的稳定性和可靠性。

在Apache的工作过程中,还涉及到一些重要的概念和技术,如虚拟主机、URL重写、缓存等。

1. 虚拟主机:虚拟主机是指在一台物理服务器上运行多个独立的网站。

Apache可以通过配置虚拟主机来实现这一功能。

每个虚拟主机有自己独立的域名或IP地址,并且可以有自己独立的配置文件。

Apache根据请求的域名或IP地址,将请求分发到相应的虚拟主机进行处理。

2. URL重写:URL重写是指将URL地址进行修改或重定向的过程。

Apache可以通过配置URL重写规则来实现这一功能。

例如,可以将带有特定后缀的URL重写为另一个URL,或者将某个URL重定向到另一个URL。

rfc相关设置及使用

rfc相关设置及使用

rfc相关设置及使用RFC(Request for Comments)是一种用于定义互联网协议、标准和相关问题的文档。

RFC的格式由互联网工程任务组(IETF)统一规定,它们记录了网络技术的发展和演进过程。

在本文中,我们将介绍RFC相关的设置和使用。

1. 了解RFC的作用和历史:RFC是由IETF组织制定的一种标准化文档,它记录了互联网协议的设计、开发和演化过程。

RFC起源于20世纪60年代的ARPANET,是一种社区驱动的文档,通过共享和讨论来推动互联网技术的发展。

RFC文档旨在提供指南、建议和最佳实践,帮助网络技术人员解决问题。

2. 寻找和阅读RFC文档:RFC文档可以在互联网上免费获取,IETF的官方网站和其他资源库都有存档。

这些文档按照顺序编号,并且以RFC开头,比如RFC 791定义了IPv4协议。

通过搜索引擎或在IETF网站上使用关键词搜索,可以找到特定主题的RFC文档。

阅读RFC文档时,应该注意文档的状态,有一些可能已经被更新或废弃。

3. 使用RFC文档:RFC文档在网络技术的发展过程中起着重要的指导作用。

它们提供了协议规范、算法实现、安全性和隐私等方面的建议。

网络管理员、网络工程师和开发人员可以使用RFC文档来了解和理解特定协议或标准的设计原理和要求。

此外,RFC文档还常用于进行互联网协议的实现、编程和配置。

4. 参与RFC的制定过程:RFC并不是静止的文件,而是一个持续演进的过程。

任何人都可以参与到RFC的制定过程中。

要参与RFC的制定,可以加入IETF并参与相关的工作组或邮件列表。

通过这种方式,个人可以提出改进建议,参与讨论和标准化的制定。

5. 遵循RFC的指导原则:在网络技术领域,遵循RFC的指导原则是至关重要的。

这些指导原则包括设计原则、协议分层、安全性和互操作性等要求。

遵循RFC的指导原则可以确保网络协议的正确性、稳定性和可靠性,同时也可以促进网络技术的发展和创新。

总结起来,RFC在互联网技术领域起着重要的作用,它们记录了互联网协议的发展历程和指导原则。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Network Working Group H. Nielsen Request for Comments: 2774 P. Leach Category: Experimental Microsoft S. Lawrence Agranat Systems February 2000 An HTTP Extension FrameworkStatus of this MemoThis memo defines an Experimental Protocol for the Internetcommunity. It does not specify an Internet standard of any kind.Discussion and suggestions for improvement are requested.Distribution of this memo is unlimited.Copyright NoticeCopyright (C) The Internet Society (2000). All Rights Reserved.IESG NoteThis document was originally requested for Proposed Standard status.However, due to mixed reviews during Last Call and within the HTTPworking group, it is being published as an Experimental document.This is not necessarily an indication of technical flaws in thedocument; rather, there is a more general concern about whether thisdocument actually represents community consensus regarding theevolution of HTTP. Additional study and discussion are needed before this can be determined.Note also that when HTTP is used as a substrate for other protocols,it may be necessary or appropriate to use other extension mechanismsin addition to, or instead of, those defined here. This documentshould therefore not be taken as a blueprint for adding extensions to HTTP, but it defines mechanisms that might be useful in suchcircumstances.Nielsen, et al. Experimental [Page 1]AbstractA wide range of applications have proposed various extensions of the HTTP protocol. Current efforts span an enormous range, includingdistributed authoring, collaboration, printing, and remote procedure call mechanisms. These HTTP extensions are not coordinated, sincethere has been no standard framework for defining extensions andthus, separation of concerns. This document describes a genericextension mechanism for HTTP, which is designed to address thetension between private agreement and public specification and toaccommodate extension of applications using HTTP clients, servers,and proxies. The proposal associates each extension with a globally unique identifier, and uses HTTP header fields to carry the extension identifier and related information between the parties involved inthe extended communication.Table of Contents1. Introduction (3)2. Notational Conventions (3)3. Extension Declarations (4)3.1 Header Field Prefixes (5)4. Extension Header Fields (6)4.1 End-to-End Extensions (7)4.2 Hop-by-Hop Extensions (7)4.3 Extension Response Header Fields (8)5. Mandatory HTTP Requests (8)5.1 Fulfilling a Mandatory Request (10)6. Mandatory HTTP Responses (11)7. 510 Not Extended (11)8. Publishing an Extension (11)9. Caching Considerations (12)10. Security Considerations (13)11. References (13)12. Acknowledgements (14)13. Authors’ Addresses (14)14. Summary of Protocol Interactions (15)15. Examples (16)15.1 User Agent to Origin Server (16)15.2 User Agent to Origin Server via HTTP/1.1 Proxy (17)15.3 User Agent to Origin Server via HTTP/1.0 Proxy (18)Full Copyright Statement (20)Nielsen, et al. Experimental [Page 2]1. IntroductionThis proposal is designed to address the tension between privateagreement and public specification; and to accommodate dynamicextension of HTTP clients and servers by software components. Thekind of extensions capable of being introduced range from:o extending a single HTTP message;o introducing new encodings;o initiating HTTP-derived protocols for new applications; to...o switching to protocols which, once initiated, run independentof the original protocol stack.The proposal is intended to be used as follows:o Some party designs and specifies an extension; the partyassigns the extension a globally unique URI, and makes one ormore representations of the extension available at that address (see section 8).o An HTTP client or server that implements this extensionmechanism (hereafter called an agent) declares the use of theextension by referencing its URI in an extension declaration in an HTTP message (see section 3).o The HTTP application which the extension declaration isintended for (hereafter called the ultimate recipient) candeduce how to properly interpret the extended message based on the extension declaration.The proposal uses features in HTTP/1.1 but is compatible withHTTP/1.0 applications in such a way that extended applications cancoexist with existing HTTP applications. Applications implementingthis proposal MUST be based on HTTP/1.1 (or later versions of HTTP).2. Notational ConventionsThis specification uses the same notational conventions and basicparsing constructs as RFC 2068 [5]. In particular the BNF constructs "token", "quoted-string", "Request-Line", "field-name", and"absoluteURI" in this document are to be interpreted as described in RFC 2068 [5].Nielsen, et al. Experimental [Page 3]The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT","SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [6].This proposal does not rely on particular features defined in URLs[8] that cannot potentially be expressed using URNs (see section 8). Therefore, the more generic term URI [8] is used throughout thespecification.3. Extension DeclarationsAn extension declaration can be used to indicate that an extensionhas been applied to a message and possibly to reserve a part of theheader namespace identified by a header field prefix (see 3.1). This section defines the extension declaration itself; section 4 defines a set of header fields using the extension declaration.This specification does not define any ramifications of applying anextension to a message nor whether two extensions can or cannotlogically coexist within the same message. It is simply a frameworkfor describing which extensions have been applied and what theultimate recipient either must or may do in order to properlyinterpret any extension declarations within that message.The grammar for an extension declaration is as follows:ext-decl = <"> ( absoluteURI | field-name ) <">[ namespace ] [ decl-extensions ]namespace = ";" "ns" "=" header-prefixheader-prefix = 2*DIGITdecl-extensions = *( decl-ext )decl-ext = ";" token [ "=" ( token | quoted-string ) ]An extension is identified by an absolute, globally unique URI or afield-name. A field-name MUST specify a header field uniquely defined in an IETF Standards Track RFC [3]. A URI can unambiguously bedistinguished from a field-name by the presence of a colon (":").The support for header field names as extension identifiers provides a transition strategy from decentralized extensions to extensionsdefined by IETF Standards Track RFCs until a mapping between theglobally unique URI space and features defined in IETF StandardsTrack RFCs has been defined according to the guidelines described in section 8.Nielsen, et al. Experimental [Page 4]Examples of extension declarations are"/extension"; ns=11"Range"An agent MAY use the decl-extensions mechanism to include optionalextension declaration parameters but cannot assume these parametersto be recognized by the recipient. An agent MUST NOT use decl-extensions to pass extension instance data, which MAY be passed using header field prefix values (see section 3.1). Unrecognized decl-extparameters SHOULD be ignored and MUST NOT be removed by proxies when forwarding the extension declaration.3.1 Header Field PrefixesThe header-prefix is a dynamically generated string. All headerfields in the message that match this string, using string prefix-matching, belong to that extension declaration. Header field prefixes allow an extension declaration to dynamically reserve a subspace ofthe header space in a protocol message in order to prevent headerfield name clashes and to allow multiple declarations using the same extension to be applied to the same message without conflicting.Header fields using a header-prefix are of the form:prefixed-header = prefix-match field-nameprefix-match = header-prefix "-"Linear white space (LWS) MUST NOT be used between the header-prefixand the dash ("-") or between the prefix-match and the field-name.The string prefix matching algorithm is applied to the prefix-matchstring.The format of the prefix using a combination of digits and the dash("-") guarantees that no extension declaration can reserve the whole header field name space. The header-prefix mechanism was preferredover other solutions for exchanging extension instance parametersbecause it is header based and therefore allows for easy integration of new extensions with existing HTTP features.Agents MUST NOT reuse header-prefix values in the same message unless explicitly allowed by the extension (see section 4.1 for a discussion of the ultimate recipient of an extension declaration).Clients SHOULD be as consistent as possible when generating header-prefix values as this facilitates use of the Vary header field inresponses that vary as a function of the request extensiondeclaration(s) (see [5], section 13.6).Nielsen, et al. Experimental [Page 5]Servers including prefixed-header header fields in a Vary headerfield value MUST also include the corresponding extension declaration field-name as part of that value. For example, if a response depends on the value of the 16-use-transform header field defined by anoptional extension declaration in the request, the Vary header field in the response could look like this:Vary: Opt, 16-use-transformNote, that header-prefix consistency is no substitute for includingan extension declaration in the message: header fields with header-prefix values not defined by an extension declaration in the samemessage are not defined by this specification.Examples of header-prefix values are121523Old applications may introduce header fields independent of thisextension mechanism, potentially conflicting with header fieldsintroduced by the prefix mechanism. In order to minimize this risk,prefixes MUST contain at least 2 digits.4. Extension Header FieldsThis proposal introduces two types of extension declaration strength: mandatory and optional, and two types of extension declaration scope: hop-by-hop and end-to-end (see section 4.1 and 4.2).A mandatory extension declaration indicates that the ultimaterecipient MUST consult and adhere to the rules given by the extension when processing the message or reporting an error (see section 5 and 7).An optional extension declaration indicates that the ultimaterecipient of the extension MAY consult and adhere to the rules given by the extension when processing the message, or ignore the extension declaration completely. An agent may not be able to distinguishwhether the ultimate recipient does not understand an extensionreferred to by an optional extension or simply ignores the extension declaration.Nielsen, et al. Experimental [Page 6]The combination of the declaration strength and scope defines a 2x2matrix which is distinguished by four new general HTTP header fields: Man, Opt, C-Man, and C-Opt. (See sections 4.1 and 4.2; also seeappendix 14, which has a table of interactions with origin serversand proxies.)The header fields are general header fields as they describe whichextensions actually are applied to an HTTP message. Optionaldeclarations MAY be applied to any HTTP message if appropriate (seesection 5 for how to apply mandatory extension declarations torequests and section 6 for how to apply them to responses).4.1 End-to-End ExtensionsEnd-to-end declarations MUST be transmitted to the ultimate recipient of the declaration. The Man and the Opt general header fields areend- to-end header fields and are defined as follows:mandatory = "Man" ":" 1#ext-decloptional = "Opt" ":" 1#ext-declFor exampleHTTP/1.1 200 OKContent-Length: 421Opt: "/Digest"; ns=1515-digest: "snfksjgor2tsajkt52"...The ultimate recipient of a mandatory end-to-end extensiondeclaration MUST handle that extension declaration as described insection 5 and 6.4.2 Hop-by-Hop ExtensionsHop-by-hop extension declarations are meaningful only for a singleHTTP connection. In HTTP/1.1, C-Man, C-Opt, and all header fieldswith matching header-prefix values defined by C-Man and C-Opt MUST be protected by a Connection header field. That is, these header fields are to be included as Connection header field directives (see [5],section 14.10). The two header fields have the following grammar:c-mandatory = "C-Man" ":" 1#ext-declc-optional = "C-Opt" ":" 1#ext-declNielsen, et al. Experimental [Page 7]For exampleM-GET / HTTP/1.1Host: some.hostC-Man: "/ProxyAuth"; ns=1414-Credentials="g5gj262jdw@4df"Connection: C-Man, 14-CredentialsThe ultimate recipient of a mandatory hop-by-hop extensiondeclaration MUST handle that extension declaration as described insection 5 and 6.4.3 Extension Response Header FieldsTwo extension response header fields are used to indicate that arequest containing mandatory extension declarations has beenfulfilled by the ultimate recipient as described in section 5.1. The extension response header fields are exclusively intended to serve as extension acknowledgements, and can not carry any other information. The Ext header field is used to indicate that all end-to-endmandatory extension declarations in the request were fulfilled:ext = "Ext" ":"The C-Ext response header field is used to indicate that all hop-by- hop mandatory extension declarations in the request were fulfilled.c-ext = "C-Ext" ":"In HTTP/1.1, the C-Ext header fields MUST be protected by aConnection header (see [5], section 14.10).The Ext and the C-Ext header fields are not mutually exclusive; they can both occur within the same message as described in section 5.1. 5. Mandatory HTTP RequestsAn HTTP request is called a mandatory request if it includes at least one mandatory extension declaration (using the Man or the C-Manheader fields). The method name of a mandatory request MUST beprefixed by "M-". For example, a client might express the bindingrights- management constraints in an HTTP PUT request as follows: Nielsen, et al. Experimental [Page 8]M-PUT /a-resource HTTP/1.1Man: "/rights-management"; ns=1616-copyright: /COPYRIGHT.html16-contributions: /PATCHES.htmlHost: Content-Length: 1203Content-Type: text/html<!doctype html ...An ultimate recipient conforming to this specification receiving amandatory request MUST process the request by performing thefollowing actions in the order listed below:1. Identify all mandatory extension declarations (both hop-by-hop and end-to-end); the server MAY ignore optional declarationswithout affecting the result of processing the HTTP message;2. Examine all extensions identified in 1) and determine if theyare supported for this message. If not, respond with a 510 (Not Extended) status-code (see section 7);3. If 2) did not result in a 510 (Not Extended) status code, then process the request according to the semantics of theextensions and of the existing HTTP method name as defined inHTTP/1.1 [5] or later versions of HTTP. The HTTP method namecan be obtained by ignoring the "M-" method name prefix.4. If the evaluation in 3) was successful and the mandatoryrequest fulfilled, the server MUST respond as defined insection 5.1. A server MUST NOT fulfill a request withoutunderstanding and obeying all mandatory extensiondeclaration(s) in a request.A proxy that does not act as the ultimate recipient of a mandatoryextension declaration MUST NOT remove the extension declaration orthe "M-" method name prefix when forwarding the message (see section5.1 for how to detect when a mandatory extension has been fulfilled).A server receiving an HTTP/1.0 (or earlier versions of HTTP) message that includes a Connection header MUST, for each connection-token in this field, remove and ignore any header field(s) from the messagewith the same name as the connection-token.A server receiving a mandatory request including the "M-" method name prefix without any mandatory extension declarations to follow MUSTreturn a 510 (Not Extended) response.Nielsen, et al. Experimental [Page 9]The "M-" prefix is reserved by this proposal and MUST NOT be used by other HTTP extensions.5.1 Fulfilling a Mandatory RequestA server MUST NOT claim to have fulfilled any mandatory requestunless it understood and obeyed all the mandatory extensiondeclarations in the request. This section defines a mechanism forconveying this information to the client in such a way that itinteroperates with existing HTTP applications and prevents brokenservers from giving the false impression that an extended request was fulfilled by responding with a 200 (Ok) response withoutunderstanding the method.If any end-to-end mandatory extension declarations were among thefulfilled extensions then the server MUST include an Ext responseheader field in the response. In order to avoid that the Ext headerfield inadvertently is cached in an HTTP/1.1 cache, the response MUST contain a no-cache cache-control directive. If the response isotherwise cachable, the no-cache cache-control directive SHOULD belimited to only affect the Ext header field:HTTP/1.1 200 OKExt:Cache-Control: no-cache="Ext"...If the mandatory request has been forwarded by an HTTP/1.0intermediary proxy then this is indicated either directly in theRequest-Line or by the presence of an HTTP/1.1 Via header field. Inthis case, the server MUST include an Expires header field with adate equal to or earlier than the value of the Date header field (see section 9 for a discussion on caching considerations):HTTP/1.1 200 OKDate: Sun, 25 Oct 1998 08:12:31 GMTExpires: Sun, 25 Oct 1998 08:12:31 GMTExt:Cache-Control: no-cache="Ext", max-age=3600...If any hop-by-hop mandatory extension declarations were among thefulfilled extensions then the server MUST include a C-Ext responseheader field in the response. The C-Ext header field MUST beprotected by a Connection header field (see [5], section 14.10). Nielsen, et al. Experimental [Page 10]HTTP/1.1 200 OKC-Ext:Connection: C-ExtNote, that the Ext and C-Ext header fields are not mutuallyexclusive; they can be both be present in a response when fulfilling mandatory request containing both hop-by-hop as well as end-to-endmandatory extension declarations.6. Mandatory HTTP ResponsesA server MUST NOT include mandatory extension declarations in an HTTP response unless it is responding to a mandatory HTTP request whosedefinition allowed for the mandatory response or the server has some a priori knowledge that the recipient can handle the extendedresponse. A server MAY include optional extension declarations inany HTTP response (see section 4).If a client is the ultimate recipient of a mandatory HTTP responsecontaining mandatory extension declarations that either the clientdoes not understand or does not want to use, then it SHOULD discardthe complete response as if it were a 500 (Internal Server Error)response.7. 510 Not ExtendedThe policy for accessing the resource has not been met in therequest. The server should send back all the information necessaryfor the client to issue an extended request. It is outside the scope of this specification to specify how the extensions inform theclient.If the 510 response contains information about extensions that werenot present in the initial request then the client MAY repeat therequest if it has reason to believe it can fulfill the extensionpolicy by modifying the request according to the information provided in the 510 response. Otherwise the client MAY present any entityincluded in the 510 response to the user, since that entity mayinclude relevant diagnostic information.8. Publishing an ExtensionWhile the protocol extension definition should be published at theaddress of the extension identifier, this specification does notrequire it. The only absolute requirement is that extensionidentifiers MUST be globally unique identifiers, and that distinctnames be used for distinct semantics.Nielsen, et al. Experimental [Page 11]Likewise, applications are not required to attempt resolvingextension identifiers included in an extension declaration. The only absolute requirement is that an application MUST NOT claimconformance with an extension that it does not recognize (regardless of whether it has tried to resolve the extension identifier or not). This document does not provide any policy for how long or how oftenan application may attempt to resolve an extension identifier.The association between the extension identifier and thespecification might be made by distributing a specification, whichreferences the extension identifier.It is strongly recommended that the integrity and persistence of the extension identifier be maintained and kept unquestioned throughoutthe lifetime of the extension. Care should be taken not to distribute conflicting specifications that reference the same name. Even when an extension specification is made available at the address of the URI, care must be taken that the specification made available at thataddress does not change over time. One agent may associate theidentifier with the old semantics, while another might associate itwith the new semantics.The extension definition may be made available in differentrepresentations ranging fromo a human-readable specification defining the extension semantics (see for example [7]),o downloadable code which implements the semantics defined by the extension,o a formal interface description provided by the extension, too a machine-readable specification defining the extensionsemantics.For example, a software component that implements the specificationmay reside at the same address as a human-readable specification(distinguished by content negotiation). The human-readablerepresentation serves to document the extension and encouragedeployment, while the software component would allow clients andservers to be dynamically extended.9. Caching ConsiderationsUse of extensions using the syntax defined by this document may have additional implications on the cachability of HTTP response messages other than the ones described in section 5.1.Nielsen, et al. Experimental [Page 12]The originator of an extended message should be able to determinefrom the semantics of the extension whether or not the extension’spresence impacts the caching constraints of the response message. If an extension does require tighter constraints on the cachebility ofthe response, the originator MUST include the appropriate combination of cache header fields (Cache-Control, Vary, Expires) correspondingto the required level of constraints of the extended semantics.10. Security ConsiderationsDynamic installation of extension facilities as described in theintroduction involves software written by one party (the provider of the implementation) to be executed under the authority of another(the party operating the host software). This opens the host party to a variety of "Trojan horse" attacks by the provider, or a maliciousthird party that forges implementations under a provider’s name. See, for example RFC2046 [4], section 4.5.2 for a discussion of theserisks.11. References[1] Crocker, D., "Standard for the Format of ARPA Internet TextMessages", STD 11, RFC 822, August 1982.[2] Berners-Lee, T., Fielding, R. and H. Frystyk, "HypertextTransfer Protocol -- HTTP/1.0", RFC 1945, May 1996.[3] Bradner, S., "The Internet Standards Process -- Revision 3", BCP 9, RFC 2026, October 1996.[4] Freed, N. and N. Borenstein, "Multipurpose Internet MailExtensions (MIME) Part Two: Media Types", RFC 2046, November1996.[5] Fielding, R., Gettys, J., Mogul, J., Frystyk, H. and T.Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", RFC2068, January 1997.[6] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.[7] Masinter, L., "Hyper Text Coffee Pot Control Protocol(HTCPCP/1.0)", RFC 2324, 1 April 1998.[8] Berners-Lee, T., Fielding, R. and L. Masinter, "Uniform Resource Identifiers (URI): Generic Syntax", RFC 2396, August 1998. Nielsen, et al. Experimental [Page 13][9] Nielsen, H., Connolly, D. and R. Khare, "PEP - an extensionmechanism for HTTP", Work in Progress.12. AcknowledgementsRoy Fielding, Rohit Khare, Yaron Y. Goland, and Koen Holtman, deserve special recognition for their efforts in commenting in all phases of this specification. Also thanks to Josh Cohen, Ross Patterson, JimGettys, Larry Masinter, and to the people involved in PEP [9].The contribution of World Wide Web Consortium (W3C) staff is part of the W3C HTTP Activity (see "/Protocols/Activity"). 13. Authors’ AddressesHenrik Frystyk NielsenMicrosoft Corporation1 Microsoft WayRedmond, WA 98052, USAEMail: frystyk@Paul J. LeachMicrosoft Corporation1 Microsoft WayRedmond, WA 98052, USAEMail: paulle@Scott LawrenceAgranat Systems, Inc.5 Clocktower Place, Suite 400Maynard, MA 01754, USAEMail: lawrence@Nielsen, et al. Experimental [Page 14]14. Summary of Protocol InteractionsThe following tables summarize the outcome of strength and scope rules of the mandatory proposal of compliant and non-compliant HTTP proxies and origin servers. The summary is intended as a guide and index tothe text, but is necessarily cryptic and incomplete. This summaryshould never be used or referenced separately from the completespecification.Table 1: Origin ServerScope Hop-by-hop End-to-endStrength Optional Required Optional Required(may) (must) (may) (must)Mandatory Standard 501 (Not Standard 501 (Notunsupported processing Implemented) processing Implemented)Extension Standard 510 (Not Standard 510 (Notunsupported processing Extended) processing Extended)Extension Extended Extended Extended Extendedsupported processing processing processing processingTable 2: Proxy ServerScope Hop-by-hop End-to-endStrength Optional Required Optional Required(may) (must) (may) (must)Mandatory Strip 501 (Not Forward 501 (Notunsupported extension Implemented) extension Implemented)or tunnel or tunnelExtension Strip 510 (Not Forward Forwardunsupported extension Extended) extension extensionExtension Extended Extended Extended Extendedsupported processing processing processing, processing,and strip and strip may strip may stripNielsen, et al. Experimental [Page 15]。

相关文档
最新文档