RayB
RayB

Reputation: 2336

What is the maximum length for a GitHub Pages URI?

For a side project I'm trying to store some data user generated content in a url so they can easily share it without me hosting the data.

When hosting on GitHub Pages I get the message: Error: URI Too Long when I have a fairly long url like this.

According to What is the maximum possible length of a query string? there is no limit in the spec but it just depends on the implementation.

I've searched for the url length limit of GitHub pages in their docs and on Google but had no luck.

Upvotes: 4

Views: 1074

Answers (1)

Rok Sprogar
Rok Sprogar

Reputation: 2401

This was an interesting question because you're making get requests, so I actually tried this myself...in case of your url, the requests start failing at exactly 8202 characters, but still work for 8201 characters...the response code for failed requests is 414 and it is returned by github's nginx server.

So, if you wanted to get your url working, Github would have to up their header buffers as explained in this answer: How to set the allowed url length for a nginx request (error code: 414, uri too large)

Upvotes: 1

Related Questions