【问题标题】:Does case matter in HSTS header Strict-Transport-Security?HSTS 标头 Strict-Transport-Security 中的大小写是否重要?
【发布时间】:2015-05-01 14:00:12
【问题描述】:

在http响应中可以有标题Strict-Transport-Security。我确信它必须用 Train-Case 编写,就像在 dropbox.com 上一样:

$ curl --silent --head https://dropbox.com | grep -i strict
Strict-Transport-Security: max-age=15552000; includeSubDomains

但是在一个网站上我看到它是用 kebab-case 写的(这个网站不能公开访问,所以我不给它链接):

$ curl --silent --head https://... | grep -i strict
strict-transport-security: max-age=31536000; includeSubDomains

在 Strict-Transport-Security 标头中使用所有小写字母是否正确?

【问题讨论】:

    标签: https http-headers hsts


    【解决方案1】:

    HTTP 规范RFC 7230 section 3.2 表示标头名称不区分大小写。因此,如果您愿意,可以将它们以小写形式发送。

    但是,传统的做法是使用规范文档的大小写来发送它们。如果只是为了让人们更轻松地解决交通问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-07-12
      • 2021-12-30
      • 2016-12-22
      • 2019-03-07
      • 2015-04-06
      • 2018-04-05
      • 2019-05-17
      • 1970-01-01
      相关资源
      最近更新 更多