Use uint32_t for httpStatus (#48946)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48946

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

Reviewed By: hoxyq

Differential Revision: D68676415

fbshipit-source-id: 748a2167fa695151095b74cf901f13951f28b0fa
This commit is contained in:
Christoph Purrer
2025-01-27 11:51:13 -08:00
committed by Facebook GitHub Bot
parent 45cd63c259
commit a419315543
2 changed files with 4 additions and 4 deletions
@@ -27,7 +27,7 @@ static constexpr std::array kTextMIMETypePrefixes{
namespace {
struct InitStreamResult {
int httpStatusCode;
uint32_t httpStatusCode;
Headers headers;
std::shared_ptr<Stream> stream;
};
@@ -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;
@@ -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 {
@@ -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.