-
Notifications
You must be signed in to change notification settings - Fork 51
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
change browserBaseUrl default value to '/' #54
Comments
Thanks for discovery @pimlie. What do you think if we default |
That would probably be even better :) @pi0 btw, will submit a pr for this in a couple of minutes (unless you are quicker) |
Oops! And we probably need to check for the same origin (which is impossible for default value as it is in the module, not runtime!) If baseURL is external like https://api.example.com or even http://localhost:8080/api it should be preserved as is not |
It seems explicitly passing browserBaseURL is safer. We can only do this in proxy mode ( |
Hmm, probably easier/faster if you have a look at this otherwise cause I am not as fast as you understanding what you mean? Eg isnt checking origin an extra feature? |
Checking again the issues, what should we do about this? |
As mentioned above, it is only safe when serving API on same domain using either proxy, serverMiddleware or serverless functions (and also taking into account that fetching another ssr route can cause infinite loop). There was also another nice idea (i guess in axios) using I think the best would be in a major release for both axios and http, we don't have any defaults (no baseURL options) and and a new option that indicates a relative path on same domain to be marked as api endpoint. ( |
What problem does this feature solve?
Currently the default value of
browserBaseUrl
isbaseUrl
which works correctly if you are running your server on localhost as well. But when running Nuxt withHOST=0.0.0.0
then baseUrl and thus browseBaseUrl still fallbacks to localhost. This is fine for baseUrl, but browserBaseUrl shouldnt probably be pointing to localhost.Related issue: nuxt/press#2 (as fix in nuxtpress I just added
browserBaseUrl: '/'
as option)What does the proposed changes look like?
Set default value for browserBaseUrl to
/
The text was updated successfully, but these errors were encountered: