8000 Preload in Strict-Transport-Security header replaces instead of appending and is used in DefaultConfig · Issue #52 · gin-contrib/secure · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Preload in Strict-Transport-Security header replaces instead of appending and is used in DefaultConfig #52
Open
@vrbalu

Description

@vrbalu

With new release v1.1.0 a STSPreload feature was required with #45 and introduced with e944b63.
When using DefaultConfig() function where currently

STSIncludeSubdomains:  true,
STSPreload:            true,

are present, the resulting header will be Strict-Transport-Security: max-age=315360000; preload. This does not follow the syntax described in MDN Web docs or in HSTS Preload site. The string should be appended instead of replaced, which will result in correct behaviour looking like Strict-Transport-Security: max-age=315360000; includeSubDomains; preload.

Additionally HSTS Preload site strongly argues, that preload should not be used as default, saying:

If you maintain a project that provides HTTPS configuration advice or provides an option to enable HSTS, do not include the preload directive by default.

With that said, I would suggest having it only as a option, but not as a part of DefaultConfig() function.

If the STSPreload will stay as a part of the DefaultConfig() function, it should be added into the function documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0