سؤال

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