-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Server should check whether header has already been set to prevent overwriting #48
Comments
Hey @9662 👋 How did you run into that problem? Can you provide a test case? |
I am afraid I no longer recall the circumstances around this issue, but looking at my activity around the reporting date, I think a realistic test case could be as follows: Have a generator middleware that extracts event-related custom metadata from the front matter and uses it to produce In the end I must have implemented this differently so I never followed up. |
@9662 Oh if there was a solution maybe you can post it. How do you want to proceed? Should we still look for a solution or close it? |
@tcrowe Seems like a had an old pull request dealing with this. Let me check if it's salvageable. |
Yup, that's the one. I just rebased and updated. |
This line:
hexo-server/lib/middlewares/route.js
Line 33 in 92338ec
interferes with my own middleware, which sets
Content-Type
for files that are not recognised bymime.lookup
, but then the header gets overwritten by the above line.The router middleware should check if the header has already been set before trying to set its value.
The text was updated successfully, but these errors were encountered: