Skip to content

Commit

Permalink
Use uint32_t for httpStatus (#48946)
Browse files Browse the repository at this point in the history
Summary:

[Changelog] [Internal] - [jsinspector-modern] Use uint32_t for httpStatus

Reviewed By: hoxyq

Differential Revision: D68676415
  • Loading branch information
christophpurrer authored and facebook-github-bot committed Jan 27, 2025
1 parent ba894c9 commit 468577e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static constexpr std::array kTextMIMETypePrefixes{
namespace {

struct InitStreamResult {
int httpStatusCode;
uint32_t httpStatusCode;
Headers headers;
std::shared_ptr<Stream> stream;
};
Expand Down Expand Up @@ -113,7 +113,7 @@ class Stream : public NetworkRequestListener,
processPending();
}

void onHeaders(int httpStatusCode, const Headers& headers) override {
void onHeaders(uint32_t httpStatusCode, const Headers& headers) override {
// Find content-type through case-insensitive search of headers.
for (const auto& [name, value] : headers) {
std::string lowerName = name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct ReadStreamParams {
struct NetworkResource {
bool success{};
std::optional<std::string> stream;
std::optional<int> httpStatusCode;
std::optional<uint32_t> httpStatusCode;
std::optional<std::string> netErrorName;
std::optional<Headers> headers;
folly::dynamic toDynamic() const {
Expand Down Expand Up @@ -111,7 +111,7 @@ class NetworkRequestListener {
* \param httpStatusCode The HTTP status code received.
* \param headers Response headers as an unordered_map.
*/
virtual void onHeaders(int httpStatusCode, const Headers& headers) = 0;
virtual void onHeaders(uint32_t httpStatusCode, const Headers& headers) = 0;

/**
* To be called by the delegate on receipt of data chunks.
Expand Down

0 comments on commit 468577e

Please sign in to comment.