New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is this a typo? #829
Comments
This is on the way out. We're setting the |
I understand about the double assignment 😄 but maybe it's somewhere else but what I observe is that the content-type set in $reponse of any page handler added by addPageFunction is royally ignored and the file extension (or htm by default) prevails because a few lines later, we do
|
Oh, now I understand. Are you using a file extension which would not exist in Can you check existing code, whether we (in LMS) set the CT in many page handlers? I fear changing the code as you suggest (which makes sense) could potentially break some handlers which currently work by chance/coincidence/or because the dev dealt with it in some other way. |
I'm using some files with no extension or with a .log extension and that where I faced the issue. Now, I surely can add an extension in the URI that is used (like it is now, did that many years ago when I hit that issue but had even less idea of what I was doing - if possible) and that will take care of the issue. I'll look at the various page handlers in LMS, but I'd assume if we make a change we'd only set the CT in case it's not already set. Failing handlers would then be ones that'd set a wrong CT but expect LMS to overload it... would be very weird |
I've looked at all addPageFunction in LMS and could not find any that sets CT. They are either html or rely on the served link extension (UPnP uses xml a fair bit) |
I committed this to 8.4 in f58f846. Please give it a try. We can easily back-port it to 8.3 if it turns out to work fine. |
Here, https://github.com/Logitech/slimserver/blob/public/8.3/Slim/Web/HTTP.pm#L1000, is this what we want? It does not take into account what $params might want in term of format. Should it be
or, if we are supposed to set $params, at least
It bit me with the log changes I was trying to make because with no extension set in the filename, I could not set content-type in the page handler, it was always ignored. That explains why.
The text was updated successfully, but these errors were encountered: