Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed additional '?' in WFS request #2048

Merged
merged 5 commits into from
Aug 1, 2017

Conversation

allyoucanmap
Copy link
Contributor

@allyoucanmap allyoucanmap commented Jul 20, 2017

Added an url parser on query to remove additional '?'

@coveralls
Copy link

Coverage Status

Coverage remained the same at 79.939% when pulling 570e11a on allyoucanmap:query-req into b170c52 on geosolutions-it:master.

@@ -122,8 +123,10 @@ const getWFSFilterData = (filterObj) => {

const getWFSFeature = (searchUrl, filterObj) => {
const data = getWFSFilterData(filterObj);
const urlParsedObj = Url.parse(searchUrl);
const parsedUrl = urlParsedObj.protocol + '//' + urlParsedObj.host + urlParsedObj.pathname;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should mix the query string parameters (service, outputFormat) with the ones coming from the original URL. So you can keep additional parameters in the URL.

return Rx.Observable.defer( () =>
axios.post(searchUrl + '?service=WFS&outputFormat=json', data, {
axios.post(parsedUrl + params, data, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this fixing the original issue of duplicate requests?

@coveralls
Copy link

Coverage Status

Coverage remained the same at 79.939% when pulling 0176f77 on allyoucanmap:query-req into b170c52 on geosolutions-it:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 79.939% when pulling 40d47f4 on allyoucanmap:query-req into b170c52 on geosolutions-it:master.

@offtherailz offtherailz changed the title Fix #2043 Query panel issues two identical requests on search. Removed additional '?' in WFS request Jul 28, 2017
const {TOGGLE_CONTROL, setControlProperty} = require('../actions/controls');
const querystring = require('querystring');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's this? I think is missing in package.json

let params = isObject(urlParsedObj.query) ? urlParsedObj.query : {};
params.service = 'WFS';
params.outputFormat = 'json';
const paramsString = querystring.stringify(params);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need other libraries. You can do all with Url.format.
Create a new object from urlParsedObj modifying the query object and call Url.format with the new object.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.005%) to 79.934% when pulling 0749a78 on allyoucanmap:query-req into b170c52 on geosolutions-it:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 80.345% when pulling e8a46e9 on allyoucanmap:query-req into 2030835 on geosolutions-it:master.

@offtherailz offtherailz merged commit 092192e into geosolutions-it:master Aug 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants