json-ld.org icon indicating copy to clipboard operation
json-ld.org copied to clipboard

Playground: 60k input permalink causes "414 Request-URI Too Large"

Open bollwyvl opened this issue 11 years ago • 4 comments

Just tried to create a permalink to a configuration with the contents of

http://www.uniprot.org/uniprot/P77967.jsonld a 60k document, which the editor, parses and linters can handle without a problem.

The server actually wouldn't accept it, saying the request was too large.

Changing the URL to use # instead of ? fixes the problem.

An easy way to fix this, without breaking backwards compatibility, would be to continue to accept ? links, but use # to generate all new links.

Thoughts?

bollwyvl avatar Mar 19 '14 18:03 bollwyvl

I’d be fine with that even though I doubt the practicality. Without using shorteners (do they even support URLs of this lenght?), such a URL is of quite limited use.

Did you know that you can put the URL of the target document in the permalink?

http://json-ld.org/playground/?json-ld=http%3A%2F%2Fwww.uniprot.org%2Funiprot%2FP77967.jsonld&frame=%7B%7D&context=%7B%7D&startTab=tab-expanded

Perhaps it would be better to make that more obvious!? And also provide a UI to enter the URL of a document/context to use

lanthaler avatar Mar 19 '14 19:03 lanthaler

Did you know that you can put the URL of the target document in the permalink?

I did not. Cool! Works great in Chrome. However, it does presuppose a pretty sunny day for security settings in the browser and remote server, and doesn't work at all in my "security-aware" browser, a stripped-down, paranoid firefox.

In this particular case, it wouldn't have exactly worked, as I wanted to post a link to a modified version of the document in question.

I agree that the URL is not the ideal engine of persistence, it's just that the the 414 error is a particularly unfriendly way to encounter it. And you are correct: bitly, tinyurl and googl will not do anything with a link that big.

So some options/future paths:

  • use #, knowing that it works, it just might not be useful
  • hide the link option once it gets big (whatever that is is)
  • push out to gist with something like this SO post

bollwyvl avatar Mar 19 '14 20:03 bollwyvl

Also, yes: some more options, like a box for document URL, and (multiple, addiitonal) boxes for context URLs would be good

bollwyvl avatar Mar 19 '14 20:03 bollwyvl

When I initially added the permalink feature I did add code that shows a "(2KB+)" warning for long links. Seems that code in performAction() isn't working anymore though? If someone wants to debug that issue, that would at least indicate huge URLs that shorteners probably can't handle. I think if you are using this feature for URLs larger than a few KB, you are doing things wrong and we should probably just help performance and not even generate the link. People will learn to properly shrink their examples to something manageable.

davidlehn avatar Mar 19 '14 20:03 davidlehn