Fix sitemap plugin can't provide xml content type in GET route (#9203)

* Update get-tiddler-html.js

* Create #9203.tid
This commit is contained in:
lin onetwo 2026-02-04 19:19:56 +08:00 committed by GitHub
parent 196683915c
commit 486d3bd326
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 2 deletions

View file

@ -33,8 +33,8 @@ exports.handler = function(request,response,state) {
}
var text = state.wiki.renderTiddler(renderType,renderTemplate,{parseAsInline: true, variables: {currentTiddler: title}});
// Naughty not to set a content-type, but it's the easiest way to ensure the browser will see HTML pages as HTML, and accept plain text tiddlers as CSS or JS
state.sendResponse(200,{},text,"utf8");
var headers = {"Content-Type": renderType};
state.sendResponse(200,headers,text,"utf8");
} else {
response.writeHead(404);
response.end();

View file

@ -0,0 +1,10 @@
title: $:/changenotes/5.4.0/#9203
description: Fix not provide content-type header in GET routes
release: 5.4.0
tags: $:/tags/ChangeNote
change-type: bugfix
change-category: nodejs
github-links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/9203
github-contributors: linonetwo
Fixed an issue which prevented plugins like the sitemap plugin from setting the correct MIME types (e.g., application/xml).