ptpb / pb

pb is a formerly-lightweight pastebin and url shortener
Other
549 stars 52 forks source link

When serving JSON responses, file-too-large should be JSON #135

Closed HalosGhost closed 8 years ago

HalosGhost commented 8 years ago

At the moment, the following is served when a file that is too large is attempted to be uploaded (even if the client specifies to receive JSON):

<html>
<head><title>413 Request Entity Too Large</title></head>
<body bgcolor="white">
<center><h1>413 Request Entity Too Large</h1></center>
<hr><center>nginx</center>
</body>
</html>

As with #134, the issue with this is that the user cannot actually rely on receiving valid JSON which makes the API less predictable and consistent.

buhman commented 8 years ago

That response, as indicated there and in the headers, is from Nginx, not pb.

This can't be fixed without either replacing/modifying nginx, or removing that particular limitation, neither of which are attractive ideas.