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

backslashes in URLs #12

Closed
NARKOZ opened this issue Oct 4, 2012 · 2 comments
Closed

backslashes in URLs #12

NARKOZ opened this issue Oct 4, 2012 · 2 comments

Comments

@NARKOZ
Copy link

NARKOZ commented Oct 4, 2012

"spec":"http:\/\/www.w3.org\/TR\/WOFF\/",
"url":"http:\/\/hacks.mozilla.org\/2009\/10\/woff\/",

Is it for escaping? According to http://www.ietf.org/rfc/rfc4627.txt it's not really required.

@CWSpear
Copy link

CWSpear commented Oct 7, 2012

I think part of the confusion comes from the more easier to understand http://json.org, where it says the forward slash (or solidus, I guess? I've never heard that word) is to be escaped (see diagram defining a string). Update: I guess you could interpret that escaping the forward slash is optional from what it says, but from looking at it, I would definitely escape them, as that's definitely "legal."

Some languages seem to escape the forward slash, like PHP's json_encode(), while other's do not, like Chrome's (and I'm sure others') implementation of JSON.stringify().

I would guess that not all of the JSON is hand authored on caniuse, and that they are using something to encode a more manageable object/array and then encoding it to JSON for the site.

It should be noted, both methods mentioned above were able to correctly decode/parse JSON with and without escaped forward slashes.

@Fyrd
Copy link
Owner

Fyrd commented Oct 7, 2012

Yeah, this was unintentional, and has now been fixed. Thanks for pointing it out! :)

@Fyrd Fyrd closed this as completed Oct 7, 2012
yellowdoge pushed a commit to yellowdoge/caniuse that referenced this issue Aug 24, 2016
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