mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-12-16 00:01:10 -05:00
fixup! adding tests for POST-to-GET redirection, both for 307 and not
This commit is contained in:
parent
0ba7112a9f
commit
d9fbd5194e
23
test/support/servlets/redirector_307.rb
Normal file
23
test/support/servlets/redirector_307.rb
Normal 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
|
||||||
Loading…
x
Reference in New Issue
Block a user