OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 FetchUtils_h | 5 #ifndef FetchUtils_h |
6 #define FetchUtils_h | 6 #define FetchUtils_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "wtf/Allocator.h" | 9 #include "wtf/Allocator.h" |
10 #include "wtf/Forward.h" | 10 #include "wtf/Forward.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 static bool isForbiddenMethod(const String& method); | 25 static bool isForbiddenMethod(const String& method); |
26 static bool isUsefulMethod(const String& method) { | 26 static bool isUsefulMethod(const String& method) { |
27 return !isForbiddenMethod(method); | 27 return !isForbiddenMethod(method); |
28 } | 28 } |
29 static bool isForbiddenHeaderName(const String& name); | 29 static bool isForbiddenHeaderName(const String& name); |
30 static bool isForbiddenResponseHeaderName(const String& name); | 30 static bool isForbiddenResponseHeaderName(const String& name); |
31 static bool isSimpleOrForbiddenRequest(const String& method, | 31 static bool isSimpleOrForbiddenRequest(const String& method, |
32 const HTTPHeaderMap&); | 32 const HTTPHeaderMap&); |
33 static AtomicString normalizeMethod(const AtomicString& method); | 33 static AtomicString normalizeMethod(const AtomicString& method); |
34 static String normalizeHeaderValue(const String& value); | 34 static String normalizeHeaderValue(const String& value); |
| 35 |
| 36 // https://fetch.spec.whatwg.org/#ok-status aka a successful 2xx status |
| 37 // code, https://tools.ietf.org/html/rfc7231#section-6.3 . We opt to use |
| 38 // the Fetch term in naming the predicate. |
| 39 static bool isOkStatus(int status) { return status >= 200 && status < 300; } |
35 }; | 40 }; |
36 | 41 |
37 } // namespace blink | 42 } // namespace blink |
38 | 43 |
39 #endif | 44 #endif |
OLD | NEW |