-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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 RCTNetworking contentType issue #35640
Conversation
Base commit: 9f9111b |
Base commit: 83afdaf |
PR build artifact for fb63097 is ready. |
PR build artifact for fb63097 is ready. |
@dmytrorykun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@dmytrorykun merged this pull request in c0834b8. |
Summary: https://github.com/facebook/react-native/blob/96027f787ade1a465569975059426d2c03ee5ad0/Libraries/Network/RCTNetworking.mm#L418 because `RCTNullIfNil(response.MIMEType)`, `contentType` may be `[NSNull null]` https://github.com/facebook/react-native/blob/96027f787ade1a465569975059426d2c03ee5ad0/Libraries/Network/RCTNetworking.mm#L114 Here only check `partContentType` is not nil, This causes the custom type never used https://github.com/facebook/react-native/blob/96027f787ade1a465569975059426d2c03ee5ad0/Libraries/Network/RCTNetworking.mm#L334 more serious here, if `dataContentType` is `[NSNull null]` , it will crash the application `-[NSNull hasPrefix:]: unrecognized selector sent to instance 0x7fff8004b700` ## Changelog [iOS] [Fixed] - fix dataContentType may be [NSNull null] issue Pull Request resolved: facebook#35640 Reviewed By: cipolleschi Differential Revision: D42067206 Pulled By: dmytrorykun fbshipit-source-id: 073e6589111f5117486b69b8206a07ef1995c5b8
Summary
react-native/Libraries/Network/RCTNetworking.mm
Line 418 in 96027f7
because
RCTNullIfNil(response.MIMEType)
,contentType
may be[NSNull null]
react-native/Libraries/Network/RCTNetworking.mm
Line 114 in 96027f7
Here only check
partContentType
is not nil, This causes the custom type never usedreact-native/Libraries/Network/RCTNetworking.mm
Line 334 in 96027f7
more serious here, if
dataContentType
is[NSNull null]
, it will crash the application-[NSNull hasPrefix:]: unrecognized selector sent to instance 0x7fff8004b700
Changelog
[iOS] [Fixed] - fix dataContentType may be [NSNull null] issue
Test Plan