Skip to content

Commit

Permalink
encode paths in the console service
Browse files Browse the repository at this point in the history
  • Loading branch information
meirish committed Feb 27, 2019
1 parent 8044d0e commit b14249b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ui/app/services/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Service from '@ember/service';
import { getOwner } from '@ember/application';
import { computed } from '@ember/object';
import { shiftCommandIndex } from 'vault/lib/console-helpers';
import { encodePath } from 'vault/utils/path-encoding-helpers';

export function sanitizePath(path) {
//remove whitespace + remove trailing and leading slashes
Expand Down Expand Up @@ -74,7 +75,7 @@ export default Service.extend({
ajax(operation, path, options = {}) {
let verb = VERBS[operation];
let adapter = this.adapter();
let url = adapter.buildURL(path);
let url = adapter.buildURL(encodePath(path));
let { data, wrapTTL } = options;
return adapter.ajax(url, verb, {
data,
Expand Down

0 comments on commit b14249b

Please sign in to comment.