-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
URL with base is always used, even when absolute URL is provided #26006
Comments
Related to #16434 |
Would this be a valid fix for this? |
Yes that looks like it would probably do the trick. |
Ok. I will open a PR then. |
Unfortunately, I think the proposed change is going to break access to localhost. See #26019 |
This is because the current validateBaseUrl expects a base url to be of the format |
Summary: Fix for bug #26006 URL with base is always used, even when absolute URL is provided ## Changelog [Javascript] [Fixed] - `URL`: Base url value is ignored when the input url is not a relative url. Pull Request resolved: #26009 Test Plan: `new URL('http://github.com', 'http://google.com')` now returns `http://github.com/` Added a test case to `URL-test.js` to verify the same. Differential Revision: D16781921 Pulled By: cpojer fbshipit-source-id: 038aca3610e34f513f603e8993f9a925b7d28626
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information. |
MDN documentation for URL states that the
base
should only be used whenurl
is a relative url. However the current implementation of URL (as of 0.60.4) in react-native always prepends the base if given.React Native version:
System:
OS: macOS 10.14.6
CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
Memory: 447.55 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.6.0 - /usr/local/bin/node
Yarn: 1.17.3 - /usr/local/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
IDEs:
Android Studio: 3.4 AI-183.6156.11.34.5692245
Xcode: 10.3/10G8 - /usr/bin/xcodebuild
npmPackages:
react: ^16.9.0 => 16.9.0
react-native: 0.60.4 => 0.60.4
npmGlobalPackages:
react-native-cli: 2.0.1
Steps To Reproduce
Describe what you expected to happen:
Snack, code example, screenshot, or link to a repository:
https://snack.expo.io/@phallguy/url-bug-report
Notice that if you view the snack with the "Web" preview, it is handled correctly.
The text was updated successfully, but these errors were encountered: