Closed damithc closed 3 years ago
What even is a WhatsApp user agent??
What even is a WhatsApp user agent??
No idea. Maybe some WhatsApp apps can open a web page inside it?
The first post I find on Google in regards to WhatsApp User-agent is that it is a bot doing HTTP requests. However, there are different answers depending on the number after WhatsApp/2.??.??.
In regards to the error, I would imagine the invalid UFT8 char is coming from the user agent and therefore not an error with the code. However, a possible fix would be to enforce another encoding which allows for the characters which are throwing the error.
I managed to reproduce the issue by including invalid UTF-8 character in one of the request parameters. However, no sane modern browser that respects the UTF-8 encoding will produce this kind of error.
For reference, the same situation in V6 will look like this:
It remains an issue that the exception is thrown as 500
instead of 400
, and it looks like it's thrown from deep within the Jetty library. The best we can do is catch that exception (if we can) and change the status code to 400
to indicate that this is a user error.
I managed to reproduce the issue by including invalid UTF-8 character in one of the request parameters. However, no sane modern browser that respects the UTF-8 encoding will produce this kind of error.
For reference, the same situation in V6 will look like this:
It remains an issue that the exception is thrown as
500
instead of400
, and it looks like it's thrown from deep within the Jetty library. The best we can do is catch that exception (if we can) and change the status code to400
to indicate that this is a user error.
How are you testing this in v7? I'm trying the following: http://localhost:4200/web/instructor/sessions/edit?courseid=test.ema-demo&fsname=Second%20team%20fe%F3dback%20session It redirects me to the home page. If I test it on the server side (localhost:8080) it correctly returns 400, not 500.
http://localhost:4200/web/instructor/sessions/edit?courseid=test.ema-demo&fsname=Second%20team%20fe%F3dback%20session
This is expected as Angular dev server knows nothing of our back-end server.
If I test it on the server side (localhost:8080) it correctly returns 400, not 500
Local Jetty server works differently from production server (another reason why GAE Java 8 is not very good). To test this change unfortunately we have no choice but to deploy and observe. The URL you showed (after changing the host) is a valid test candidate. You might want to test calling some web API endpoints as well.
Error message from live server
Note: in all cases of this nature, the user agent seems to be WhatsApp