Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: on iOS not getting 304 from If-None-Match request #45263

Closed

Conversation

huzhanbo1996
Copy link
Contributor

Summary:

In #44483 If-None-Match request failed to get a 304 after a 200 response. This is caused by NSRequest's
cachePolicy which prevents sending a request to server to check 304 state and return directly a 200 response.

Changelog:

[IOS] [FIXED] - fix: on iOS not getting 304 from If-None-Match request

Test Plan:

repeat request given in #44483

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Jul 3, 2024
@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 19,691,034 -609,854
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 22,896,039 -601,461
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: 3c6762a
Branch: main

@facebook-github-bot
Copy link
Contributor

@dmytrorykun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@dmytrorykun merged this pull request in b8ab0fe.

Copy link

github-actions bot commented Jul 5, 2024

This pull request was successfully merged by @huzhanbo1996 in b8ab0fe.

When will my fix make it into a release? | How to file a pick request?

@@ -365,6 +365,12 @@ - (RCTURLRequestCancellationBlock)buildRequest:(NSDictionary<NSString *, id> *)q
forHTTPHeaderField:@"Content-Length"];
}

// NSRequest default cache policy violate on `If-None-Match`, should allow the request
// to get 304 from server.
if (request.allHTTPHeaderFields[@"If-None-Match"]) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is case sensitive. Will there be cases where these headers come with lower casing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants