Closed Chessax closed 6 years ago
@ethanchewy While it's nice to see this "fixed" so quickly, you didn't actually solve anything. Adding 'json'
as an argument does nothing, since the function only accepts three arguments: jQuery.getJSON( url [, data ] [, success ] )
. You have to change the jQuery function to $.post
as well (which accepts an additional dataType
argument: jQuery.post( url [, data ] [, success ] [, dataType ]
)
Unfortunately I'm not very proficient at using git or I'd submit a pull request (or whatever it is called).
Thank you! Just fixed it over here: https://github.com/ethanchewy/PythonBuddy/commit/a11cb93f0f55246416d26b3a81a717a34e45e24e
If the code is longer than the server specified allowed request limit (seemingly 8KB) a HTTP 414 error is returned. This is because HTTP GET is used, and can easily be fixed by using HTTP POST.
E.g. replacing in javascript.js: https://github.com/ethanchewy/PythonBuddy/blob/895ecbcbbe4e7053913af4b60365cf1c3c31f7b1/static/js/javascript.js#L88-L95
With this:
If this limit is intentional, then there are still better ways to handle it than just "crashing". E.g. just checking the length of the string to be sent to the server beforehand, and telling the user that is the case.