Skip to content

Commit

Permalink
Make OctoPrint.upload's url behave like others
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
foosel committed Dec 7, 2016
1 parent 0de6718 commit 8d2681a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/octoprint/static/js/app/client/base.js
Expand Up @@ -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);
});
Expand Down

0 comments on commit 8d2681a

Please sign in to comment.