本文整理汇总了C++中HTTPMessage::setSecure方法的典型用法代码示例。如果您正苦于以下问题:C++ HTTPMessage::setSecure方法的具体用法?C++ HTTPMessage::setSecure怎么用?C++ HTTPMessage::setSecure使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTTPMessage
的用法示例。
在下文中一共展示了HTTPMessage::setSecure方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getGetRequest
TEST_F(HTTP2CodecTest, BasicHeader) {
HTTPMessage req = getGetRequest("/guacamole");
req.getHeaders().add("user-agent", "coolio");
// Connection header will get dropped
req.getHeaders().add("Connection", "Love");
req.setSecure(true);
upstreamCodec_.generateHeader(output_, 1, req, 0, true /* eom */);
parse();
callbacks_.expectMessage(true, 2, "/guacamole");
EXPECT_TRUE(callbacks_.msg->isSecure());
const auto& headers = callbacks_.msg->getHeaders();
EXPECT_EQ("coolio", headers.getSingleOrEmpty("user-agent"));
EXPECT_EQ("www.foo.com", headers.getSingleOrEmpty("host"));
}
示例2: getGetRequest
TEST_F(HTTP2CodecTest, BasicHeader) {
HTTPMessage req = getGetRequest("/guacamole");
req.getHeaders().add("user-agent", "coolio");
// Connection header will get dropped
req.getHeaders().add("Connection", "Love");
req.setSecure(true);
upstreamCodec_.generateHeader(output_, 1, req, 0);
parse([] (IOBuf *ingress) {
// for now, hack the END_STREAM flag in
ingress->writableData()[4 + http2::kConnectionPreface.length()] |=
http2::END_STREAM;
});
callbacks_.expectMessage(true, 2, "/guacamole");
EXPECT_TRUE(callbacks_.msg->isSecure());
const auto& headers = callbacks_.msg->getHeaders();
EXPECT_EQ("coolio", headers.getSingleOrEmpty("user-agent"));
EXPECT_EQ("www.foo.com", headers.getSingleOrEmpty("host"));
}