Add additional HTTP 1.1 definitions that are useful in HTTP
applications, such as User-Agent, Location, and HTTP Version string with
and without the CRLF.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <el...@hpe.com>
---
 MdePkg/Include/IndustryStandard/Http11.h | 51 ++++++++++++++++++++++++--------
 1 file changed, 39 insertions(+), 12 deletions(-)

diff --git a/MdePkg/Include/IndustryStandard/Http11.h 
b/MdePkg/Include/IndustryStandard/Http11.h
index 6c22f94..44de8c8 100644
--- a/MdePkg/Include/IndustryStandard/Http11.h
+++ b/MdePkg/Include/IndustryStandard/Http11.h
@@ -3,7 +3,7 @@
 
   This file contains common HTTP 1.1 definitions from RFC 2616 
    
-  (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
+  (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
   which accompanies this distribution.  The full text of the license may be 
found at
@@ -24,8 +24,8 @@
 /// The version of an HTTP message is indicated by an HTTP-Version field
 /// in the first line of the message.
 ///
-#define HTTP_VERSION        "HTTP/1.1"
-
+#define HTTP_VERSION_STR       "HTTP/1.1"
+#define HTTP_VERSION_CRLF_STR  " HTTP/1.1\r\n"
 
 ///
 /// HTTP Request Method definitions
@@ -43,7 +43,11 @@
 #define HTTP_METHOD_CONNECT "CONNECT"
 #define HTTP_METHOD_PATCH   "PATCH"
 
-#define HTTP_METHOD_MAXIMUM_LEN  sizeof ("CONNECT")
+///
+/// Connect method has maximum length according to EFI_HTTP_METHOD defined in
+/// UEFI2.5 spec so use this.
+///
+#define HTTP_METHOD_MAXIMUM_LEN  sizeof (HTTP_METHOD_CONNECT)
 
 ///
 /// Accept Request Header
@@ -106,7 +110,7 @@
 #define HTTP_CONTENT_ENCODING_GZIP     "gzip"      /// Content-Encoding: GNU 
zip format (described in RFC 1952).
 #define HTTP_CONTENT_ENCODING_COMPRESS "compress"  /// encoding format 
produced by the common UNIX file compression program "compress". 
 #define HTTP_CONTENT_ENCODING_DEFLATE  "deflate"   /// The "zlib" format 
defined in RFC 1950 in combination with the "deflate" 
-                                                    /// compression mechanism 
described in RFC 1951.
+                                                   /// compression mechanism 
described in RFC 1951.
 
 
 ///
@@ -152,13 +156,37 @@
 
 
 ///
+/// User Agent Request Header
+/// 
+/// The User-Agent request-header field contains information about the user 
agent originating 
+/// the request. This is for statistical purposes, the tracing of protocol 
violations, and 
+/// automated recognition of user agents for the sake of tailoring responses 
to avoid 
+/// particular user agent limitations. User agents SHOULD include this field 
with requests. 
+/// The field can contain multiple product tokens and comments identifying the 
agent and any 
+/// subproducts which form a significant part of the user agent. 
+/// By convention, the product tokens are listed in order of their 
significance for 
+/// identifying the application.
+///
+#define HTTP_HEADER_USER_AGENT         "User-Agent"
+
+///
 /// Host Request Header
 ///
 /// The Host request-header field specifies the Internet host and port number 
of the resource 
 /// being requested, as obtained from the original URI given by the user or 
referring resource 
 ///
-#define  HTTP_HEADER_HOST              "Host"
+#define HTTP_HEADER_HOST              "Host"
 
+///
+/// Location Response Header
+/// 
+/// The Location response-header field is used to redirect the recipient to a 
location other than 
+/// the Request-URI for completion of the request or identification of a new 
resource. 
+/// For 201 (Created) responses, the Location is that of the new resource 
which was created by 
+/// the request. For 3xx responses, the location SHOULD indicate the server's 
preferred URI for 
+/// automatic redirection to the resource. The field value consists of a 
single absolute URI.
+///
+#define HTTP_HEADER_LOCATION           "Location"
 
 ///
 /// The If-Match request-header field is used with a method to make it 
conditional.
@@ -170,7 +198,7 @@
 /// to prevent inadvertent modification of the wrong version of a resource. 
 /// As a special case, the value "*" matches any current entity of the 
resource.
 ///
-#define  HTTP_HEADER_IF_MATCH          "If-Match"
+#define HTTP_HEADER_IF_MATCH          "If-Match"
 
 
 ///
@@ -182,7 +210,7 @@
 /// to prevent a method (e.g. PUT) from inadvertently modifying an existing 
resource when the 
 /// client believes that the resource does not exist.
 ///
-#define  HTTP_HEADER_IF_NONE_MATCH     "If-None-Match"
+#define HTTP_HEADER_IF_NONE_MATCH     "If-None-Match"
 
 
 
@@ -192,17 +220,16 @@
 /// containing the authentication information of the user agent for
 /// the realm of the resource being requested.
 ///
-#define  HTTP_HEADER_AUTHORIZATION     "Authorization"
+#define HTTP_HEADER_AUTHORIZATION     "Authorization"
 
 ///
 /// ETAG Response Header
 /// The ETag response-header field provides the current value of the entity 
tag 
 /// for the requested variant. 
 ///
-#define  HTTP_HEADER_ETAG              "ETag"
-
-
+#define HTTP_HEADER_ETAG              "ETag"
 
 
 #pragma pack()
+
 #endif
-- 
2.6.3.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to