Does Ring request {:scheme :https} guarantee a HTTPS connection?

左心房为你撑大大i 提交于 2020-01-16 03:44:11

问题


If the Ring request map key :scheme has value of :https, is it guaranteed that a HTTPS connection has been established and there were no certificate errors?


回答1:


This is probably a question that relates to whatever servlet container you're using rather than ring.

ring-servlet populates the :scheme key by getting a value from the HttpServletRequest:

:scheme (keyword (.getScheme request))

The servlet specification has only this to say about getScheme:

Returns the name of the scheme used to make this request, for example, http, https, or ftp. Different schemes have different rules for constructing URLs, as noted in RFC 1738.

Interestingly, ring-servlet does not call the isSecure method on the servlet request. So I think your question should probably be:

"When using <insert your container name here> is it possible for getScheme() on a ServletRequest to return "https" when isSecure() returns false?"



来源:https://stackoverflow.com/questions/26140811/does-ring-request-scheme-https-guarantee-a-https-connection

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