summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/Source/core/fetch/FetchUtils.h
blob: c2ff2e4cb4232146e469fe166830bdce8aeb1a35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef FetchUtils_h
#define FetchUtils_h

#include "core/CoreExport.h"
#include "wtf/Allocator.h"
#include "wtf/Forward.h"

namespace blink {

class HTTPHeaderMap;

class CORE_EXPORT FetchUtils {
    STATIC_ONLY(FetchUtils);
public:
    static bool isSimpleMethod(const String& method);
    static bool isSimpleHeader(const AtomicString& name, const AtomicString& value);
    static bool isSimpleRequest(const String& method, const HTTPHeaderMap&);
    static bool isForbiddenMethod(const String& method);
    static bool isUsefulMethod(const String& method) { return !isForbiddenMethod(method); }
    static bool isForbiddenHeaderName(const String& name);
    static bool isForbiddenResponseHeaderName(const String& name);
    static bool isSimpleOrForbiddenRequest(const String& method, const HTTPHeaderMap&);
    static AtomicString normalizeMethod(const AtomicString& method);
    static String normalizeHeaderValue(const String& value);
};

} // namespace blink

#endif