proxygen
RFC2616.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-present, Facebook, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree. An additional grant
7  * of patent rights can be found in the PATENTS file in the same directory.
8  *
9  */
10 #pragma once
11 
12 #include <folly/Optional.h>
13 #include <folly/Range.h>
15 #include <string>
16 
17 namespace proxygen {
18 
19 class HTTPHeaders;
20 
21 namespace RFC2616 {
22 
34 enum class BodyAllowed {
35  DEFINED,
38 };
40 
47 bool responseBodyMustBeEmpty(unsigned status);
48 
54 bool bodyImplied(const HTTPHeaders& headers);
55 
69 using TokenQPair = std::pair<folly::StringPiece, double>;
70 
71 bool parseQvalues(folly::StringPiece value, std::vector<TokenQPair> &output);
72 
86  unsigned long& firstByte,
87  unsigned long& lastByte,
88  unsigned long& instanceLength);
89 
90 }}
bool bodyImplied(const HTTPHeaders &headers)
Definition: RFC2616.cpp:59
bool responseBodyMustBeEmpty(unsigned status)
Definition: RFC2616.cpp:54
BodyAllowed isRequestBodyAllowed(folly::Optional< HTTPMethod > method)
Definition: RFC2616.cpp:43
std::pair< folly::StringPiece, double > TokenQPair
Definition: RFC2616.h:69
static const char *const value
Definition: Conv.cpp:50
bool parseByteRangeSpec(folly::StringPiece value, unsigned long &outFirstByte, unsigned long &outLastByte, unsigned long &outInstanceLength)
Definition: RFC2616.cpp:105
bool parseQvalues(folly::StringPiece value, std::vector< TokenQPair > &output)
Definition: RFC2616.cpp:64