lrkrol / Noctifer-Music

PHP HTML5 music player for self-hosted online libraries
GNU General Public License v3.0
56 stars 16 forks source link

5863 character limit for all media files in a single folder? #15

Open joecola opened 10 months ago

joecola commented 10 months ago

I'm running into an error where if the total number of characters for all MP3 filenames in a single folder exceeds 5863 characters, I get the generic frontend: "Internal Server Error", error.log: "Premature end of script headers" when trying to play a song. Initially, the page will load fine and display the list and player. The error occurs only when trying to play a song.

This does not pertain to the total number of files, or one specific file exceeding a maximum character length.

I tested PHP 8.1 and 8.2 on Apache/2.4.29 (Ubuntu) and Apache 2.4.52 (x64) Windows.

This test was performed by simply renaming one of the files, padding with extra characters until the error occurs, and then removing a character. Adding and removing a single alphanumeric character from one of the files causes and then fixes the error.

My initial guess before more troubleshooting is that it pertains to exceeding a cookie or session size, or something to do with the json storage.

lrkrol commented 7 months ago

Hmm yes, this sounds like it may be due to the maximum cookie size. I currently save the full active song list, which can be the entire contents of a directory, as a cookie. I realise now that this is probably unnecessary, but it's also not now trivial to change. Could you do a check of your current browser's cookie limits, for example here?