mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
resolved: https://github.com/facebook/react-native/pull/37501 fix for https://github.com/facebook/react-native/issues/36794.
This commit is contained in:
@@ -312,7 +312,17 @@ static void attemptAsynchronousLoadOfBundleAtURL(
|
||||
return;
|
||||
}
|
||||
|
||||
RCTSource *source = RCTSourceCreate(scriptURL, data, data.length);
|
||||
// Prefer `Content-Location` as the canonical source URL, if given, or fall back to scriptURL.
|
||||
NSURL *sourceURL = scriptURL;
|
||||
NSString *contentLocationHeader = headers[@"Content-Location"];
|
||||
if (contentLocationHeader) {
|
||||
NSURL *contentLocationURL = [NSURL URLWithString:contentLocationHeader relativeToURL:scriptURL];
|
||||
if (contentLocationURL) {
|
||||
sourceURL = contentLocationURL;
|
||||
}
|
||||
}
|
||||
|
||||
RCTSource *source = RCTSourceCreate(sourceURL, data, data.length);
|
||||
parseHeaders(headers, source);
|
||||
onComplete(nil, source);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user