proxygen
HeaderIndexingStrategy.cpp
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  */
11 
12 namespace proxygen {
13 
15  static const HeaderIndexingStrategy* instance = new HeaderIndexingStrategy();
16  return instance;
17 }
18 
20  // Handle all the cases where we want to return false in the switch statement
21  // below; else let the code fall through and return true
22  switch(header.name.getHeaderCode()) {
24  if (header.value.find('=') != std::string::npos) {
25  return false;
26  }
27  if (header.value.find("jpg") != std::string::npos) {
28  return false;
29  }
30  break;
31 
32  // The wrapped header should never be HTTP_HEADER_NONE but for completeness
33  // the condition is included below
34  case HTTP_HEADER_NONE:
38  return false;
39 
40  default:
41  break;
42  }
43 
44  return true;
45 }
46 
47 }
HTTPHeaderCode getHeaderCode() const
virtual bool indexHeader(const HPACKHeader &header) const
HPACKHeaderName name
Definition: HPACKHeader.h:82
size_type find(const basic_fbstring &str, size_type pos=0) const
Definition: FBString.h:1724
static const HeaderIndexingStrategy * getDefaultInstance()
folly::fbstring value
Definition: HPACKHeader.h:83