Make OctoPrint.upload's url behave like others
So far only was interpreted relatively to the defined base url. We want this to behave like other requests from the client lib though, so now it does.
This commit is contained in:
parent
0de6718af3
commit
8d2681ae3f
1 changed files with 6 additions and 1 deletions
|
|
@ -222,7 +222,12 @@
|
|||
|
||||
var headers = OctoPrint.getRequestHeaders();
|
||||
|
||||
request.open("POST", OctoPrint.getBaseUrl() + url);
|
||||
var urlToCall = url;
|
||||
if (!_.startsWith(url, "http://") && !_.startsWith(url, "https://")) {
|
||||
urlToCall = OctoPrint.getBaseUrl() + url;
|
||||
}
|
||||
|
||||
request.open("POST", urlToCall);
|
||||
_.each(headers, function(value, key) {
|
||||
request.setRequestHeader(key, value);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue