1c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved. 2c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 3c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)// found in the LICENSE file. 4c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles) 5c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)#ifndef FetchUtils_h 6c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)#define FetchUtils_h 7c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles) 8c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)#include "wtf/Forward.h" 9c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles) 10c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)namespace blink { 11c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles) 12c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)class HTTPHeaderMap; 13c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles) 14c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)class FetchUtils { 15c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)public: 16c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles) static bool isSimpleMethod(const String& method); 17c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles) static bool isSimpleHeader(const AtomicString& name, const AtomicString& value); 18c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles) static bool isSimpleRequest(const String& method, const HTTPHeaderMap&); 19c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles) static bool isForbiddenMethod(const String& method); 20c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles) static bool isUsefulMethod(const String& method) { return !isForbiddenMethod(method); } 21c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles) static bool isForbiddenHeaderName(const String& name); 22c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles) static bool isForbiddenResponseHeaderName(const String& name); 23c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles) static bool isSimpleOrForbiddenRequest(const String& method, const HTTPHeaderMap&); 24c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles) 25c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)private: 26c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles) FetchUtils(); // = delete; 27c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)}; 28c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles) 29c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)} // namespace blink 30c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles) 31c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)#endif 32