Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: net/http/http_util.h

Issue 2871913004: net: add IsMethodIdempotent() to HttpUtil (Closed)
Patch Set: RFC Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_HTTP_HTTP_UTIL_H_ 5 #ifndef NET_HTTP_HTTP_UTIL_H_
6 #define NET_HTTP_HTTP_UTIL_H_ 6 #define NET_HTTP_HTTP_UTIL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 // Parses a Retry-After header that is either an absolute date/time or a 69 // Parses a Retry-After header that is either an absolute date/time or a
70 // number of seconds in the future. Interprets absolute times as relative to 70 // number of seconds in the future. Interprets absolute times as relative to
71 // |now|. If |retry_after_string| is successfully parsed and indicates a time 71 // |now|. If |retry_after_string| is successfully parsed and indicates a time
72 // that is not in the past, fills in |*retry_after| and returns true; 72 // that is not in the past, fills in |*retry_after| and returns true;
73 // otherwise, returns false. 73 // otherwise, returns false.
74 static bool ParseRetryAfterHeader(const std::string& retry_after_string, 74 static bool ParseRetryAfterHeader(const std::string& retry_after_string,
75 base::Time now, 75 base::Time now,
76 base::TimeDelta* retry_after); 76 base::TimeDelta* retry_after);
77 77
78 // True if the request method is "safe" (per section 4.2.1 of RFC 7231). 78 // Returns true if the request method is "safe" (per section 4.2.1 of
79 // RFC 7231).
79 static bool IsMethodSafe(const std::string& method); 80 static bool IsMethodSafe(const std::string& method);
80 81
82 // Returns true if the request method is idempotent (per section 4.2.2 of
83 // RFC 7231).
84 static bool IsMethodIdempotent(const std::string& method);
85
81 // Returns true if it is safe to allow users and scripts to specify the header 86 // Returns true if it is safe to allow users and scripts to specify the header
82 // named |name|. 87 // named |name|.
83 static bool IsSafeHeader(const std::string& name); 88 static bool IsSafeHeader(const std::string& name);
84 89
85 // Returns true if |name| is a valid HTTP header name. 90 // Returns true if |name| is a valid HTTP header name.
86 static bool IsValidHeaderName(const base::StringPiece& name); 91 static bool IsValidHeaderName(const base::StringPiece& name);
87 92
88 // Returns false if |value| contains NUL or CRLF. This method does not perform 93 // Returns false if |value| contains NUL or CRLF. This method does not perform
89 // a fully RFC-2616-compliant header value validation. 94 // a fully RFC-2616-compliant header value validation.
90 static bool IsValidHeaderValue(const base::StringPiece& value); 95 static bool IsValidHeaderValue(const base::StringPiece& value);
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 // True if quotes values are required to be properly quoted; false if 449 // True if quotes values are required to be properly quoted; false if
445 // mismatched quotes and other problems with quoted values should be more 450 // mismatched quotes and other problems with quoted values should be more
446 // or less gracefully treated as valid. 451 // or less gracefully treated as valid.
447 bool strict_quotes_; 452 bool strict_quotes_;
448 }; 453 };
449 }; 454 };
450 455
451 } // namespace net 456 } // namespace net
452 457
453 #endif // NET_HTTP_HTTP_UTIL_H_ 458 #endif // NET_HTTP_HTTP_UTIL_H_
OLDNEW
« no previous file with comments | « components/data_reduction_proxy/core/common/data_reduction_proxy_util.cc ('k') | net/http/http_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698