Comparison

mod_http_oauth2/mod_http_oauth2.lua @ 5396:ac7c5669e5f5

mod_http_oauth2: Return status 405 for GET to endpoints without GET handler Endpoints that only do POST have the weird side effect that a GET query to them return 404, which doesn't quite feel like the right semantics.
author Kim Alvefur <zash@zash.se>
date Sun, 30 Apr 2023 17:04:55 +0200
parent 5394:434ee49b04de
child 5397:18b57e91b5e5
comparison
equal deleted inserted replaced
5395:82207f936f1f 5396:ac7c5669e5f5
916 body = templates.js; 916 body = templates.js;
917 } or nil; 917 } or nil;
918 918
919 -- Some convenient fallback handlers 919 -- Some convenient fallback handlers
920 ["GET /register"] = { headers = { content_type = "application/schema+json" }; body = json.encode(registration_schema) }; 920 ["GET /register"] = { headers = { content_type = "application/schema+json" }; body = json.encode(registration_schema) };
921 ["GET /token"] = function() return 405; end;
922 ["GET /revoke"] = function() return 405; end;
921 }; 923 };
922 }); 924 });
923 925
924 local http_server = require "net.http.server"; 926 local http_server = require "net.http.server";
925 927