fixup! adding tests for POST-to-GET redirection, both for 307 and not

This commit is contained in:
HoneyryderChuck 2024-06-05 18:09:13 +01:00
parent 0ba7112a9f
commit d9fbd5194e

View File

@ -0,0 +1,23 @@
# frozen_string_literal: true
require_relative "test"
class Redirector307Server < TestServer
class RedirectPostApp < WEBrick::HTTPServlet::AbstractServlet
def do_POST(_req, res) # rubocop:disable Naming/MethodName
res.set_redirect(WEBrick::HTTPStatus::TemporaryRedirect, "/")
end
end
class PostApp < WEBrick::HTTPServlet::AbstractServlet
def do_POST(_req, res) # rubocop:disable Naming/MethodName
res.body = "ok"
end
end
def initialize(options = {})
super
mount("/", PostApp)
mount("/307", RedirectPostApp)
end
end