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

stripTrailingSlash and query parametres #29

Open
fjgarlin opened this issue Jun 10, 2014 · 2 comments
Open

stripTrailingSlash and query parametres #29

fjgarlin opened this issue Jun 10, 2014 · 2 comments

Comments

@fjgarlin
Copy link

When using stripTrailingSlash = true and then calling client.create({ data }, { QUERY }) then the initial setting is ignored.

Line 354 of v1.0.2 could be refactored to something else. Useful link:
http://stackoverflow.com/questions/4740364/jquery-check-and-remove-slash-from-the-end-of-url-read

Changing that line for the following should fix the issue:

        var urlEnd = url.indexOf("?");
        if(urlEnd == -1){
            urlEnd = url.length;
        }

        // Don't bother doing anything if the URL is empty
        if (urlEnd > 0){
            if (url[urlEnd - 1] == "/"){
                url = url.substr(0, urlEnd-1) + url.substr(urlEnd);
            }    
        }   
@AlexeyKosov
Copy link

Still no fix? It this project live?

@rubiodamian
Copy link

+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