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

Extra ampersands appearing for multiple querystring parameters #13

Open
bmidgett opened this issue Apr 15, 2014 · 2 comments
Open

Extra ampersands appearing for multiple querystring parameters #13

bmidgett opened this issue Apr 15, 2014 · 2 comments

Comments

@bmidgett
Copy link

If you have multiple parameters, a trailing ampersand will appear if only the first parameter is enabled. Also, an extra ampersand appears in front of the parameter if only the last one is selected. This is corrected by adding the following code to BuildUriPath(template, uriParameters):
// cleanup path
path = path.replace("&&", "&");
path = path.replace("/?", "?");

@RDultsin
Copy link

@bmidgett: Good find. I think the change to clean up URI path with query string off ampersands left by dis-selecting optional parameters should be by adding the three middle lines as below:

        // cleanup path
        while (path.indexOf("&&") >= 0) {
            path = path.replace("&&", "&");
        }
        path = path.replace("/?", "?");

@Kilowhisky
Copy link

This also happens when you de-select trailing parameters. Here's the code i used to fix it for me. This was an If block and i just changed it to a while

       // remove trailing '&'
        while(path.charAt(path.length - 1) == '&') {
            path = path.substr(0, path.length - 1);
        }

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

No branches or pull requests

3 participants