1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 03:57:21 +00:00

Fix Comment in Webserver API route tidlers.json (#4557)

This commit fixes the the comment in the route
`recipes/default/tiddlers.json` which was inconsistent with the actually
used regex. Furthermore, the 403 response was adjusted to also agree
with the the new comment and the regex.

Co-authored-by: tobidot <post@tobidot.net>
This commit is contained in:
idotobi 2020-04-20 14:07:06 +02:00 committed by GitHub
parent 5688670da6
commit 154e886873
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,7 +3,7 @@ title: $:/core/modules/server/routes/get-tiddlers-json.js
type: application/javascript
module-type: route
GET /recipes/default/tiddlers/tiddlers.json?filter=<filter>
GET /recipes/default/tiddlers.json?filter=<filter>
\*/
(function() {
@ -22,7 +22,7 @@ exports.handler = function(request,response,state) {
var filter = state.queryParameters.filter || DEFAULT_FILTER;
if($tw.wiki.getTiddlerText("$:/config/Server/AllowAllExternalFilters") !== "yes") {
if($tw.wiki.getTiddlerText("$:/config/Server/ExternalFilters/" + filter) !== "yes") {
console.log("Blocked attempt to GET /recipes/default/tiddlers/tiddlers.json with filter: " + filter);
console.log("Blocked attempt to GET /recipes/default/tiddlers.json with filter: " + filter);
response.writeHead(403);
response.end();
return;