Max_url_length is only 500 characters, could that be increased?


(CoinGame) #1

Hey everyone,

Is there a reason the max_url_length is only 500 characters? With the domain character limit of 100 and the URL length of 500 it puts a max of 600 characters for a topic URL. Though up to 2000 characters should be fine.

This limit is breaking a tool that we started using on our forum. If you take a look at the long URL on this topic post you’ll see what I mean. From what I understand it should be okay to increase the max_url_length quite a lot from this current 500 limit. Any thoughts on why this value is chosen for the limit, or if it could be increased? I’d be happy to submit a PR that bumps it up to 1500 or so.


(Jeff Atwood) #2

What tool are you referring to, the one that got broken?


(CoinGame) #3

It’s this github page.

http://ttutdxh-nubits.github.io/cointoolkit

It accepts parameters which are usually much longer than 500 characters. For instance this one from the example above.

http://ttutdxh-nubits.github.io/cointoolkit/?mode=bitcoin&verify=0100000001e638f0fb85c3402f72a92a7b77718d0c6ceb8ab1f6f88b026eb7caa377e3d41700000000fd5f0100473044022048fe926a262880ceb336c9bac87ef1c41e217b69d2d6a36f9b4e21c51355fee502202acf091cc70da631d50ed1b7b1748aededf03b0d4063a2bb226b2ec42ece9c18014d130155210234139729dd413c84a71a0bfd6f236790be861b37311cef3240277c940e4b0c072102435b894b94b4b27dd24436b3f9ad0b9409d855ab4be6e91141d445804e84750b2102e2fcdfe246e9cd4864d9119b8af465487385eccd0ea30a8cb21d44d36818189f210312cd6eb361c9ebb0d90e44946492a237eab4c7a7d88a0db800f2f460937cc22f21034b0bd0f653d4ac0a2e9e81eb1863bb8e5743f6cb1ea40d845b939c225a1a80ff2103661a4370dfcfbcea25d1800057220f4572b6eecab95bb0670e8676a9e34451dc2103a5fc09a5de595e4758bfbc3a932e2c448cc49a557dd6e64788cee530a76225212103da8082062298c40f0b473b74f3c95b57eaaebe3e67ed30ce56347b2e727915fb58aeffffffff01107a0700000000001976a9142d6ae904b78be00874a1b966dd727944e76957d488ac00000000

Discourse is truncating the URL which breaks the decoding.


(ttutdxh) #4

@codinghorror click on that long link and discourse will redirect your browser to /click/track on the discourse engine to track the link, and then it will issue a redirection to the original link but truncated to 500 chars.

It is because of this, and links should be valid up to around 2048 chars.


(CoinGame) #5

No comment on this at all? I’d really just like to have an explanation to forum users why some things wont work on our forum. If this is not something that will be changed that’s fine. Let me simplify my question question a bit…

Why is the topic URL limited to 500 characters?


(Sam Saffron) #6

I am open to increasing it to 2000, but a far simpler patch is disabling the click tracker for giant urls, its a lot of info to store for very little value.


(CoinGame) #7

Cool. I’ll leave it up to you guys on the best approach. If disableing the tracking on longer URLs works for you it works for me. I know our issue is probably an outlier but your proposed change would be appreciated.


(Jeff Atwood) #8

I also think it’s a generally a bad idea to generate URLs this long @coingame – it’s rather user hostile. Even as you can see in the above reply where the URL was printed, it’s this long string of noise.


(CoinGame) #9

If we’re talking aesthetically sure, it’s ugly. But we know that the big ugly URL could be converted to something nice and cute like this. In some communities (like ours) these long URLs are understandable. I suppose a workaround is to have people posting these types of links with a URL shortener. That really feels like a hack though. Given the solution proposed above I have a better understanding of why the limit exists, but I think this is still a usability pain.

I would appreciate if the app natively ignored tracking on long URLs if it resolves the issue. Discourse offers a means to resolve the aesthetics of long URLs, but as of right now they are functionally broken.

In any direction this issue takes, thank you for the responses. I have a much better understanding of “why” and so it makes it easier to explain to community members of the situation with the URLs they’re sharing.


#10

I have the same problem and I thought, if it is not possible to have a fix, we could have a warning displayed next to big URL links that advises user to right click copy the full link (that workaround even works on mobile).