Skip to content

Commit

Permalink
Enable strict validation on HTTP1x and 2 codecs for HTTPUpstreamSessi…
Browse files Browse the repository at this point in the history
…on tests

Summary: Default to strict validation on HTTPUpstreamSession unit tests for the HTTP1xCodec and the HTTP2Codec.

Reviewed By: hanidamlaj

Differential Revision: D68578930

fbshipit-source-id: e81cf56b5c2d667f8413075fbd641d752ccd2724
  • Loading branch information
Joanna Jo authored and facebook-github-bot committed Jan 23, 2025
1 parent f9dcc8a commit 1cc191f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions proxygen/lib/http/session/test/HTTPUpstreamSessionTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,14 @@ class HTTPUpstreamTest
param = codec->getDefaultWindowSize();
}
}

auto rawCodec = codec.get();
if (dynamic_cast<HTTP1xCodec*>(rawCodec) != nullptr) {
dynamic_cast<HTTP1xCodec*>(rawCodec)->setStrictValidation(true);
} else if (dynamic_cast<HTTP2Codec*>(rawCodec) != nullptr) {
dynamic_cast<HTTP2Codec*>(rawCodec)->setStrictValidation(true);
}

httpSession_ = new HTTPUpstreamSession(
transactionTimeouts_.get(),
std::move(folly::AsyncTransport::UniquePtr(transport_)),
Expand Down

0 comments on commit 1cc191f

Please sign in to comment.