Applying defaults with a base URL
See original GitHub issueI’m not sure if i misunderstood or this is a bug/awkwardness, but essentially:
(new URLPattern({pathname: '/foo'})).pattern;
// produces:
{
"hash": "*",
"hostname": "*",
"password": "*",
"pathname": "/foo",
"port": "*",
"protocol": "*",
"search": "*",
"username": "*"
}
(new URLPattern({pathname: '/foo', baseURL})).pattern;
// produces:
{
"hash": "",
"hostname": "",
"password": "",
"pathname": "/foo",
"port": "",
"protocol": "",
"search": "",
"username": ""
}
this means the computed regex patterns become ^$
in the latter, rather than ^(.*)$
.
so we can’t rely on defaults if we have a base URL? the comment i quoted seems to hint at the fact that its on purpose, but it feels like the behaviour should be the same to me
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Setting baseURL in default configuration · Issue #175 - GitHub
To resolve this I think the defaults should be passed to the Axios constructor for the axios instance. Then change to axios.defaults =...
Read more >How to set default baseUrl - javascript - Stack Overflow
I'm using RequireJS, and all my modules reside in /payloads/backend/application .
Read more >SEO URLs / Set default application for request domain (base url)
I'm looking to specify one of our applications as the default site for prod. I've set up a site rule with the base...
Read more >Config Defaults | Axios Docs
You can specify config defaults that will be applied to every request. Global axios defaults. axios.defaults.baseURL = 'https://api.example ...
Read more >Understand Default URL Pattern - Contentstack
Understand Default URL Pattern. In Contentstack, the URL is the location of your web property. It is made up of two parts: Base...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
By the way, this discussion might be better as a https://github.com/WICG/urlpattern spec issue.
@kenchris I think this can probably be closed unless you want to update some documentation within this repo.