Skip to content
This repository has been archived by the owner on Mar 28, 2019. It is now read-only.

Odd escaping of slashes in URLs in /v1/ endpoint #224

Open
pdehaan opened this issue Mar 26, 2015 · 4 comments
Open

Odd escaping of slashes in URLs in /v1/ endpoint #224

pdehaan opened this issue Mar 26, 2015 · 4 comments

Comments

@pdehaan
Copy link
Contributor

pdehaan commented Mar 26, 2015

I'm seeing some unexpected results when trying to request the /v1/ endpoint, specifically around the escaping of the slashes in the URLs:

{"url":"https:\/\/readinglist.stage.mozaws.net","documentation":"https:\/\/readinglist.readthedocs.org\/","version":"1.3.0","hello":"readinglist"}

curl:

$ curl https://readinglist.stage.mozaws.net/v1/
{"url":"https:\/\/readinglist.stage.mozaws.net","documentation":"https:\/\/readinglist.readthedocs.org\/","version":"1.3.0","hello":"readinglist"}

httpie:

This seems to correctly convert the backslashes. 🤷

$ http GET https://readinglist.stage.mozaws.net/v1/

HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,X-Conditions-Accepted
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Expose-Headers: Backoff, Retry-After, Alert
Access-Control-Max-Age: 1728000
Backoff: None
Connection: keep-alive
Content-Length: 146
Content-Type: application/json; charset=UTF-8
Date: Thu, 26 Mar 2015 22:17:43 GMT

{
    "documentation": "https://readinglist.readthedocs.org/",
    "hello": "readinglist",
    "url": "https://readinglist.stage.mozaws.net",
    "version": "1.3.0"
}
@leplatrem
Copy link
Contributor

Yes, this comes from the usage of ujson.

I'll probably submit a PR there to disable escaping of forward slashes. Even if it is in the JSON specs, it's a bit ugly :)

@leplatrem
Copy link
Contributor

@leplatrem
Copy link
Contributor

The PR was merged :)

As soon as ujson has a new release, we'll be able to get rid of those.

@Natim
Copy link
Contributor

Natim commented Nov 2, 2015

Well a forked release has been made here: https://pypi.python.org/pypi/ultrajson/1.34

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants