문제

I want to set the protocol to https when making a request with Rack::MockRequest

client = Rack::MockRequest.new(@app)

#something like this?
env = @app.env.merge("rack.url_scheme" => "https")
response = client.get("/", env)

How do I do it?

Here are the Rack docs.

도움이 되었습니까?

해결책

response = client.get("/", "rack.url_scheme" => "https")

should work

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top