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
fix: add correct mimetype for xsl and xslt, fixes #5457 #5458
Conversation
This will still need a custom image tag pushed, we'll work on that. Were you able to manually test it by changing /etc/nginx/mime.types? |
After starting my ddev test project, I executed include mime.types
+ types {
+ application/xslt+xml xsl xslt;
+ } After kicking nginx, I get this:
Which is what we wanted. I then made sure pre-existing mime.types weren't affected by requesting a few other files:
|
Thank you! |
I'm quite sure we'll be successful getting this into DDEV core, perhaps a point release in November. I should note that in the meantime you can just use a .ddev/web-build/Dockerfile to add the file. Just put the mime.types in .ddev/web-build and I think this would work for the Dockerfile:
Thanks for your thoughtful approach to testing solving this, and for the PR! Are you going to try to get it in upstream? |
Thank you. That's a lot simpler than what I was doing 😓
https://trac.nginx.org/nginx/ticket/2552 |
Impressive! |
60aaa98
to
234d8c6
Compare
Pushed a tagged image for this feature, updated the tag DDEV uses, and rebased. Please test manually @apotek , thanks! Artifacts at #5458 (comment) |
Download the artifacts for this pull request:
See Testing a PR |
It looks to me like it's working:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok to me, tests ok, will look forward to your manual test results. Make sure to remove any custom Dockerfile that you may be using...
Thank you @rfay . I read the docs and honestly am unsure of what to do in order to test this. Since this PR does not modify
and then, be able to use ddev-webserver-prod:v1.22.4-alpha1-18-g23 when I run Can I somehow change
to point to my locally generated nginx-fpm container? I apologize if this should be obvious to me or if I am missing something. I did read https://ddev.readthedocs.io/en/latest/developers/building-contributing/#making-changes-to-ddev-images and https://ddev.readthedocs.io/en/latest/developers/building-contributing/#making-changes-to-ddev-images several times. I don't think I would want to push my built image, since I don't want to publish it either to the ddev docker account or my own. I just want to use the built image locally. So that's where I am getting confused. |
All you have to do is download the ddev artifacts from this PR, you don't have to build anything. And use them. Unzip ddev, follow the instructions, put it in your path or explicitly path it. Then use it in your project. If that doesn't make any sense I'll be happy to do a screenshare call with you, come on over to Discord or whatever, https://discord.gg/hCZFfAMc5k There is nothing you have to do with DDEV images. I pushed the changed image for you. All you need to use is the updated DDEV in this PR, #5458 (comment) - It will pull the image that I pushed that has your changes in it. But when you test, make sure you're testing without the Dockerfile you may have added in .ddev/web-build/Dockerfile, which would make your testing invalid. |
Aha! So the binary is modified to use a different tag/image name that you have already pushed up! Now it all makes sense. Thank you! I was getting auth issues on push (for obvious reasons). My test:
Success :) |
Thanks for chasing this down! And the upstream issues were a special treat. |
Add correct mimetype for xsl and xslt
Resolves: #5457
The Issue
XSL and XSLT files are being served by nginx with the default mimetype (application/octet-stream instead of the standard
application/xslt+xml
.This means that the
content-type
header is sending the wrong application type to the XSLT parser/transformer application and it therefore fails to process.How This PR Solves The Issue
This code change
overrides the shipping debian /etc/nginx/mime.types with our own ddev-managed /etc/nginx/mime.types file so we can more easily make fixes to the mime types while waiting for the upstream distro to be updated.adds atypes{}
section to the nginx.conf just under theinclude mime.types
directive where we can add custom mimetypes for ddev.Manual Testing Instructions
curl -is "https://yoursite.ddev.site/test.xsl" | grep content-type
You should see
content-type: application/xslt+xml
in the output.Automated Testing Overview
No tests added. Is there a framework for scripting a test for this in ddev? I read through the testing docs but that all surrounds tests for ddev itself. Please let me know if there is a recommended way I can create a test for this.
Related Issue Link(s)
#5457
Release/Deployment Notes
This does not affect the behavior of other parts of ddev itself.
If a user's application relies on a non-standards-compliant content-type mimetype for .xsl / .xslt files, their application may fail, as we are now serving .xsl and .xslt files according to W3 standards.
This merge request sponsored by Chromatic.