helmet
Version, currently 0.2.05 versions
- 0.2.3latestFeb 16, 2026
- 0.2.2not indexedJun 26, 2026
- 0.2.1not indexedJun 26, 2026
- 0.2.0not indexedJun 26, 2026
- 0.1.0not indexedJun 26, 2026
github.com/EvanHahn/crystal-helmet
Help secure web apps with various HTTP headers
29 stars
0 dependents
License: MIT
Nothing has been indexed for 0.2.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
helmet:
github: EvanHahn/crystal-helmet
version: ~> 0.2.0Then run:
shards installshard.yml
No shard.yml has been indexed for 0.2.0. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
# Helmet
Helmet helps you secure your Crystal web apps by setting various HTTP headers. *It's not a silver bullet*, but it can help!
This is a port of the [Node.js version of Helmet](https://github.com/helmetjs/helmet).
## Installation
Add this to your application's `shard.yml`:
```yaml
dependencies:
helmet:
github: EvanHahn/crystal-helmet
```
## Usage
```crystal
require "http/server"
require "helmet"
server = HTTP::Server.new(
[
Helmet::DNSPrefetchControllerHandler.new,
Helmet::FrameGuardHandler.new,
Helmet::InternetExplorerNoOpenHandler.new,
Helmet::NoSniffHandler.new,
Helmet::StrictTransportSecurityHandler.new(7.day),
Helmet::XSSFilterHandler.new,
]) do |context|
context.response.content_type = "text/plain"
context.response.print "Hello world!"
end
address = server.bind_tcp(8080)
server.listen
```
Helmet is really just a collection of smaller handlers that set HTTP headers. See them listed in the example above and in [the documentation](https://evanhahn.github.io/crystal-helmet/).
## Contributing
1. Fork it (https://github.com/EvanHahn/crystal-helmet/fork)
2. Create your branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add XYZ'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new pull request
## Contributors
- [Evan Hahn](https://evanhahn.com) - creator, maintainer
- [Du Ba Thach](https://bthachdev.github.io/) - [#3](https://github.com/EvanHahn/crystal-helmet/pull/3)
- [Serdar Doğruyol](https://serdardogruyol.com/) - [#9](https://github.com/EvanHahn/crystal-helmet/pull/9)
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.2.0- Tagged
- Jun 26, 2026
- Commit
637aa46e497b- Indexed
- not yet
Dependents
No indexed shard depends on this one yet.
Repository
github.com/EvanHahn/crystal-helmet
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 12, 2026
- Synced
- Aug 12, 2026
- Versions
- 5