How to I specify that the protocol is https in a Rack::MockRequest?

走远了吗. 提交于 2019-12-25 06:32:00

问题


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.


回答1:


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

should work



来源:https://stackoverflow.com/questions/23603133/how-to-i-specify-that-the-protocol-is-https-in-a-rackmockrequest

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!