Skip to content

Commit

Permalink
Merge pull request #2124 from weaveworks/2123-search-errors
Browse files Browse the repository at this point in the history
Removed leading slash from getAllNodes() api request
  • Loading branch information
jpellizzari authored Jan 13, 2017
2 parents 4d50c69 + 71485db commit bd32580
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion client/app/scripts/utils/web-api-utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import debug from 'debug';
import reqwest from 'reqwest';
import trimStart from 'lodash/trimStart';

import { blurSearch, clearControlError, closeWebsocket, openWebsocket, receiveError,
receiveApiDetails, receiveNodesDelta, receiveNodeDetails, receiveControlError,
Expand Down Expand Up @@ -123,7 +124,9 @@ export function getAllNodes(getState, dispatch) {
state.get('topologyUrlsById')
.reduce((sequence, topologyUrl, topologyId) => sequence.then(() => {
const optionsQuery = buildOptionsQuery(topologyOptions.get(topologyId));
return fetch(`${topologyUrl}?${optionsQuery}`);
// Trim the leading slash from the url before requesting.
// This ensures that scope will request from the correct route if embedded in an iframe.
return fetch(`${trimStart(topologyUrl, '/')}?${optionsQuery}`);
})
.then(response => response.json())
.then(json => dispatch(receiveNodesForTopology(json.nodes, topologyId))),
Expand Down

0 comments on commit bd32580

Please sign in to comment.