500 on very long URLs instead of pages or 414

Bug reports for SVR.JS itself.
This forum is locked, please report issues on SVR.JS Git server.
User avatar
DorianNiemiecSVRJS
Administrator
Posts: 32
Joined: July 7th, 2023, 12:00 am
Location: Poland
Gender:
Contact:

exclamation 500 on very long URLs instead of pages or 414

Post by DorianNiemiecSVRJS »

Title: 500 error on very long URLs instead of serving static pages or 414 error
Platform/Software Version: SVR.JS 3.4.21 or older, 3.7.1 or older
Steps to Reproduce:
  1. Install SVR.JS
  2. Enable HTTPS and HTTP/2
  3. Start SVR.JS
  4. Visit very long URL page (without query string) using HTTP/2, for example https://forum.svrjs.org/abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
Expected Behavior: Static file served, 404 Not Found or 414 URI Too Long error.
Actual Behavior: 500 Internal Server Error with ENAMETOOLONG code in JavaScript error stack
Additional Information:
This bug is reproduced, if HTTP/2 is enabled, since Node.JS will not emit clientError event in case of those URLs. If HTTP/2 is not enabled, Node.JS will emit clientError event and SVR.JS will return 414 URI Too Long or other client error. If significant length is in query string, the bug wouldn't be triggered.
Last edited by DorianNiemiecSVRJS on August 21st, 2023, 8:11 pm, edited 1 time in total.
I oppose "You may be a victim of software counterfeiting" windows.
When I see school students' PHP code, I may ask: But where is mysqli_real_escape_string?
Download SVR.JS
User avatar
DorianNiemiecSVRJS
Administrator
Posts: 32
Joined: July 7th, 2023, 12:00 am
Location: Poland
Gender:
Contact:

thumbup Re: 500 on very long URLs instead of pages or 414

Post by DorianNiemiecSVRJS »

Thank you for bug report! I did fix it in SVR.JS 3.4.22 and SVR.JS 3.7.2.
I oppose "You may be a victim of software counterfeiting" windows.
When I see school students' PHP code, I may ask: But where is mysqli_real_escape_string?
Download SVR.JS
Locked