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

Use a different parameter type for query parameters and path parameters #2603

Closed
christopherthielen opened this issue Mar 3, 2016 · 4 comments

Comments

@christopherthielen
Copy link
Contributor

Path parameters default to string type, which does the silly custom slash encoding from / to ~2F.

Query parameters don't need custom encoding because $location doesn't have special slash handling for query parameters.

We should have a different param type for "path" and "query" parameters. Query parameter type should not do slash encoding, while path parameter type should.

@christopherthielen christopherthielen added this to the 0.2.19 milestone Mar 3, 2016
@burzum
Copy link

burzum commented Mar 11, 2016

👍

@brettjacobson
Copy link

👍

1 similar comment
@alexb0011
Copy link

👍

@christopherthielen
Copy link
Contributor Author

My perspective has shifted since I created this issue.

We delegate to $location to set the query string. $location always calls encodeURIComponent (via encodeUriQuery(). Even if we create a non-path-encoded type, $location will still encode it.

Instead of ?param=~2Ffoo~2F we end up with ?query=%2Ffoo%2F. While it's slightly better, I don't think it's that much of a difference.

This plunker shows how it would have been without special encoding: http://plnkr.co/edit/qEpsXGi1CBUpQt240e65?p=preview

@christopherthielen christopherthielen removed this from the 0.2.19 milestone May 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants