Skip to content

Commit 20054ee

Browse files
hanidamlajfacebook-github-bot
authored andcommitted
remove AcceptorConfiguration::allowedPlaintextUpgradeProtocols
Summary: * we're seeking to deprecate native upgrades (i.e. upgrading http/1.1->http/2 via "connection: upgrade" header) Reviewed By: afrind Differential Revision: D74831717 fbshipit-source-id: a06097ab74861e6171ff35e6c6e850ec1447dd8f
1 parent 1532063 commit 20054ee

File tree

4 files changed

+0
-30
lines changed

4 files changed

+0
-30
lines changed

hphp/runtime/server/proxygen/proxygen-server.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,6 @@ ProxygenServer::ProxygenServer(
269269
m_httpsConfig->initialReceiveWindow = kStreamFlowControl;
270270
m_httpsConfig->receiveSessionWindowSize = kConnFlowControl;
271271
if (Cfg::Server::EnableH2C) {
272-
m_httpConfig->allowedPlaintextUpgradeProtocols = {
273-
proxygen::http2::kProtocolCleartextString };
274272
m_httpConfig->initialReceiveWindow = kStreamFlowControl;
275273
m_httpConfig->receiveSessionWindowSize = kConnFlowControl;
276274
}

third-party/proxygen/src/proxygen/lib/http/session/HTTPDefaultSessionCodecFactory.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ proxygen::HTTPCodecFactory::CodecConfig getCodecConfigFromAcceptorConfig(
1616
const proxygen::AcceptorConfiguration& accConfig) {
1717
proxygen::HTTPCodecFactory::CodecConfig config;
1818
config.h1.forceHTTP1xCodecTo1_1 = accConfig.forceHTTP1_0_to_1_1;
19-
config.h1.allowedH1UpgradeProtocols =
20-
accConfig.allowedPlaintextUpgradeProtocols;
2119
config.h2.headerIndexingStrategy = accConfig.headerIndexingStrategy;
2220
return config;
2321
}

third-party/proxygen/src/proxygen/lib/http/session/test/HTTPDefaultSessionCodecFactoryTest.cpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,27 +39,6 @@ TEST(HTTPDefaultSessionCodecFactoryTest, GetCodecH2) {
3939
EXPECT_EQ(http1Codec->getProtocol(), CodecProtocol::HTTP_1_1);
4040
}
4141

42-
TEST(HTTPDefaultSessionCodecFactoryTest, GetCodecUpgradeProtocols) {
43-
std::list<std::string> plainTextUpgrades = {http2::kProtocolCleartextString};
44-
auto conf = std::make_shared<AcceptorConfiguration>();
45-
conf->allowedPlaintextUpgradeProtocols = plainTextUpgrades;
46-
HTTPDefaultSessionCodecFactory factory(std::move(conf));
47-
48-
auto codec =
49-
factory.getCodec("http/1.1", TransportDirection::DOWNSTREAM, false);
50-
HTTP1xCodec* downstreamCodec = dynamic_cast<HTTP1xCodec*>(codec.get());
51-
EXPECT_NE(downstreamCodec, nullptr);
52-
EXPECT_FALSE(downstreamCodec->getAllowedUpgradeProtocols().empty());
53-
EXPECT_EQ(downstreamCodec->getAllowedUpgradeProtocols(),
54-
http2::kProtocolCleartextString);
55-
56-
// If TLS, we should not attempt to upgrade.
57-
codec = factory.getCodec("http/1.1", TransportDirection::DOWNSTREAM, true);
58-
downstreamCodec = dynamic_cast<HTTP1xCodec*>(codec.get());
59-
EXPECT_NE(downstreamCodec, nullptr);
60-
EXPECT_TRUE(downstreamCodec->getAllowedUpgradeProtocols().empty());
61-
}
62-
6342
TEST(HTTPDefaultSessionCodecFactoryTest, GetCodec) {
6443
auto conf = std::make_shared<AcceptorConfiguration>();
6544
HTTPDefaultSessionCodecFactory factory(std::move(conf));

third-party/proxygen/src/proxygen/lib/services/AcceptorConfiguration.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ struct AcceptorConfiguration : public wangle::ServerSocketConfig {
4646
*/
4747
std::string plaintextProtocol;
4848

49-
/**
50-
* Comma separated string of protocols that can be upgraded to from HTTP/1.1
51-
*/
52-
std::list<std::string> allowedPlaintextUpgradeProtocols;
53-
5449
/**
5550
* True if HTTP/1.0 messages should always be serialized as HTTP/1.1
5651
*

0 commit comments

Comments
 (0)