proxygen
proxygen::HeaderIndexingStrategy Class Reference

#include <HeaderIndexingStrategy.h>

Inheritance diagram for proxygen::HeaderIndexingStrategy:
proxygen::NoPathIndexingStrategy

Public Member Functions

 HeaderIndexingStrategy ()
 
virtual ~HeaderIndexingStrategy ()
 
virtual bool indexHeader (const HPACKHeader &header) const
 

Static Public Member Functions

static const HeaderIndexingStrategygetDefaultInstance ()
 

Detailed Description

Definition at line 16 of file HeaderIndexingStrategy.h.

Constructor & Destructor Documentation

proxygen::HeaderIndexingStrategy::HeaderIndexingStrategy ( )
inline

Definition at line 24 of file HeaderIndexingStrategy.h.

Referenced by getDefaultInstance().

24 {}
virtual proxygen::HeaderIndexingStrategy::~HeaderIndexingStrategy ( )
inlinevirtual

Definition at line 25 of file HeaderIndexingStrategy.h.

References indexHeader().

25 {}

Member Function Documentation

const HeaderIndexingStrategy * proxygen::HeaderIndexingStrategy::getDefaultInstance ( )
static

Definition at line 14 of file HeaderIndexingStrategy.cpp.

References HeaderIndexingStrategy().

Referenced by proxygen::HPACKEncoderBase::HPACKEncoderBase(), and proxygen::QPACKEncoder::QPACKEncoder().

14  {
15  static const HeaderIndexingStrategy* instance = new HeaderIndexingStrategy();
16  return instance;
17 }
bool proxygen::HeaderIndexingStrategy::indexHeader ( const HPACKHeader header) const
virtual

Reimplemented in proxygen::NoPathIndexingStrategy.

Definition at line 19 of file HeaderIndexingStrategy.cpp.

References folly::basic_fbstring< E, T, A, Storage >::find(), proxygen::HPACKHeaderName::getHeaderCode(), proxygen::HTTP_HEADER_COLON_PATH, proxygen::HTTP_HEADER_CONTENT_LENGTH, proxygen::HTTP_HEADER_IF_MODIFIED_SINCE, proxygen::HTTP_HEADER_LAST_MODIFIED, proxygen::HTTP_HEADER_NONE, proxygen::HPACKHeader::name, and proxygen::HPACKHeader::value.

Referenced by proxygen::HPACKEncoder::encodeHeader(), proxygen::NoPathIndexingStrategy::indexHeader(), proxygen::QPACKEncoder::shouldIndex(), TEST_F(), and ~HeaderIndexingStrategy().

19  {
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 }

The documentation for this class was generated from the following files: