Skip to content

Commit

Permalink
ui: skip key parameter being exposed to URL
Browse files Browse the repository at this point in the history
  • Loading branch information
karussell committed Jan 16, 2017
1 parent 57e9898 commit 861db97
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions web/src/main/webapp/js/graphhopper/GHRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ GHRequest.prototype.createGPXURL = function (withRoute, withTrack, withWayPoints
};

GHRequest.prototype.createHistoryURL = function () {
return this.createPath("?" + this.createPointParams(true)) + "&use_miles=" + !!this.useMiles;
var skip = {"key": true};
return this.createPath("?" + this.createPointParams(true), skip) + "&use_miles=" + !!this.useMiles;
};

GHRequest.prototype.createPointParams = function (useRawInput) {
Expand All @@ -180,9 +181,12 @@ GHRequest.prototype.createPointParams = function (useRawInput) {
return (str);
};

GHRequest.prototype.createPath = function (url) {
GHRequest.prototype.createPath = function (url, skipParameters) {
for (var key in this.api_params) {
var val = this.api_params[key];
if(skipParameters && skipParameters[key])
continue;

if (GHRoute.isArray(val)) {
for (var keyIndex in val) {
url += "&" + encodeURIComponent(key) + "=" + encodeURIComponent(val[keyIndex]);
Expand Down
2 changes: 1 addition & 1 deletion web/src/main/webapp/js/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 861db97

Please sign in to comment.