Ring请求{:scheme:https}是否保证HTTPS连接? [英] Does Ring request {:scheme :https} guarantee a HTTPS connection?

查看:773
本文介绍了Ring请求{:scheme:https}是否保证HTTPS连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果Ring请求映射键:scheme 的值为:https ,那么它保证HTTPS连接已经建立并且没有证书错误?

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?

推荐答案

这可能是一个问题,涉及到你使用的servlet容器

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

ring-servlet通过:scheme github.com/ring-clojure/ring/blob/8927e9b3f556874720321078c85a62fcf9a23f1b/ring-servlet/src/ring/util/servlet.clj#L42rel =nofollow>从HttpServletRequest获取值

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

:scheme(keyword(.getScheme request))

servlet规范只有这样来说明 getScheme

The servlet specification has only this to say about getScheme:


返回名称用于发出此请求的方案,例如http,
https或ftp。

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.

有趣的是,ring-servlet 不会对servlet请求调用 isSecure 方法。所以我想你的问题应该是:

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

当使用<插入你的容器名称这里>是一个ServletRequest的getScheme当isSecure()返回false时,https?

这篇关于Ring请求{:scheme:https}是否保证HTTPS连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆