go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
45.32k stars 5.51k forks source link

Set HSTS header #3788

Open PaulSzymanski opened 6 years ago

PaulSzymanski commented 6 years ago

Since version 1.4.0 Gitea can redirect from port 80 to 443 by itself but a reverse proxy is still necessary to set the HSTS header...

techknowlogick commented 6 years ago

Linking this to #305 as it is related

zeripath commented 5 years ago

This should be easy to do if anyone is able to look into the standard.

techknowlogick commented 5 years ago

I've just published: https://github.com/techknowlogick/macaron-hsts (import URL: src.techknowlogick.com/macaron-hsts) which can be added as a middleware to set the header