Closed heruan closed 9 years ago
This does not work for me:
http.configure(conf=>{
conf.withBaseUrl("http://localhost:51713");
conf.withDefaults({method: "POST", credentials: "include"});
});
this._http.fetch("http://localhost:8080/Resources/menustore.json", { method: "GET",})
,
creates a Request with http://localhost:51713http://localhost:8080/Resources/menustore.json as url
This is http-client
repo, it seems you're using fetch-client
.
@Cedware heruan is correct; you're using aurelia/fetch-client. I have opened a PR that fixes the problem in that library. It should go out in the next release. Thanks for the report!
Since I'm reading
Link
headers from a remote service and they are absolute URIs, I need to strip thebaseUrl
before using myhttp-client
instance configured with abaseUrl
; I think it would be logical to ignore thebaseUrl
when a path starts withhttp[s]://
.See PR https://github.com/aurelia/http-client/pull/102.