proxygen
HTTPErrorPage.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 #include <folly/io/IOBuf.h>
13 
14 using std::string;
15 
16 namespace proxygen {
17 
18 HTTPStaticErrorPage::HTTPStaticErrorPage(std::unique_ptr<folly::IOBuf> content,
19  const string& contentType):
20  content_(std::move(content)),
21  contentType_(contentType) {
22 }
23 
25  uint64_t /*requestID*/,
26  unsigned /*httpStatusCode*/,
27  const std::string& /*reason*/,
28  std::unique_ptr<folly::IOBuf> /*body*/,
29  const std::string& /*detailReason*/) const {
30 
31  return HTTPErrorPage::Page(contentType_, content_->clone());
32 }
33 
34 }
std::unique_ptr< folly::IOBuf > content_
Definition: HTTPErrorPage.h:66
HTTPStaticErrorPage(std::unique_ptr< folly::IOBuf > content, const std::string &contentType="text/html; charset=utf-8")
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
STL namespace.
Page generate(uint64_t requestID, unsigned httpStatusCode, const std::string &reason, std::unique_ptr< folly::IOBuf > body, const std::string &detailReason) const override
const char * string
Definition: Conv.cpp:212