• Stars
    star
    28
  • Rank 853,600 (Top 18 %)
  • Language
    Crystal
  • License
    MIT License
  • Created about 8 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

a port of the Node Helmet module to the Crystal programming language

Helmet

Build Status

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.

Installation

Add this to your application's shard.yml:

dependencies:
  helmet:
    github: EvanHahn/crystal-helmet

Usage

require "http/server"
require "helmet"

server = HTTP::Server.new("0.0.0.0", 8080,
  [
    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

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.

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

More Repositories

1

HumanizeDuration.js

361000 becomes "6 minutes, 1 second"
JavaScript
1,506
star
2

Express.js-in-Action-code

Code from "Express.js in Action", a little book I wrote
JavaScript
166
star
3

ffmpeg-buddy

a lil webpage that helps you write ffmpeg commands
HTML
147
star
4

brainfuck-web-app

a web app written in Brainfuck that returns your user-agent to you
Brainfuck
138
star
5

English-text-highlighting

experiment: what if English text was highlighted
JavaScript
73
star
6

ScriptInclude

asynchronously load .js
JavaScript
45
star
7

dotfiles

Moved to https://gitlab.com/EvanHahn/dotfiles.
Shell
45
star
8

two-factor-auth-list

a list of websites supporting two-factor authentication
PHP
30
star
9

deep-proxy

obj.very.deeply.nested.property.isNow = 'possible'
JavaScript
15
star
10

haha.sh

a bash script that generates hearty laughter
Shell
15
star
11

tiny-coming-soon-page

a tiny "coming soon" page
HTML
14
star
12

Unity-RTS-camera

A little script for RTS games in Unity. Abandoned. Add an issue if you want to take over!
C#
14
star
13

airtable-cli

a command line interface to Airtable (WIP)
JavaScript
11
star
14

wren-please

Assertion library for Wren.
10
star
15

iscp

interactive scp
Shell
9
star
16

arraywrap.js

source moved to https://git.sr.ht/~evanhahn/arraywrap.js
JavaScript
6
star
17

check-ecmascript-version-compatibility

Test files for ES5 compatibility
JavaScript
6
star
18

functional-state-machine.js

a tiny javascript state machine that's just a function
JavaScript
6
star
19

SnackWrap

after changing a file, run a command. Abandoned. Add an issue if you want to take over!
Python
6
star
20

js13kgames-2013

my entry to js13kgames 2013
JavaScript
6
star
21

atom-language-brainfuck

Brainfuck syntax for Atom
6
star
22

evanhahn-dot-com

Repo now lives on Sourcehut
HTML
6
star
23

opt-out-list

Opt out of ad tracking on various websites
5
star
24

cyborg.txt

robots.txt utilities for Node
JavaScript
5
star
25

canvas-to-favicon

take a 16x16 canvas and send it to the favicon
JavaScript
5
star
26

node-persisted-json-object

make a normal object persist as JSON
JavaScript
4
star
27

MouseTracker.js

keep mouse.x and mouse.y updated
JavaScript
4
star
28

pomo

a command-line Pomodoro timer
Ruby
4
star
29

percentage.js

Project is now at https://git.sr.ht/~evanhahn/percentage.js
JavaScript
4
star
30

JSCPP

Port some JavaScript to C++.
C++
4
star
31

Gribbagrab

load them resources. Abandoned. Contact me if you want to take over!
JavaScript
4
star
32

Evan-Hahn-Project-Skeleton

PRETTY OUTDATED YEAH
C++
4
star
33

BRAINFUCK2000

A BRAINFUCK INTERPRETER FOR THE STARS
JavaScript
4
star
34

flood

my take on a Video Game
JavaScript
4
star
35

stackoverflow.com-q-30337525-804100

answering http://stackoverflow.com/q/30337525/804100
Ruby
4
star
36

braintree-hosted-fields-bootstrap

An unofficial jQuery plugin for Braintree's Hosted Fields and the Bootstrap framework.
HTML
4
star
37

code-doodles

doodles made of code
CoffeeScript
4
star
38

user-agent-bag

RFC-respecting User-Agent serialization and deserialization
JavaScript
3
star
39

setAttributes

call .setAttribute on a DOM node more easily
JavaScript
3
star
40

scrabbler

a python scrabble solver
Python
3
star
41

QRIt

Simple webpage that generates QR codes.
HTML
3
star
42

coinflip.js

randomly return true or false
JavaScript
3
star
43

image-to-table

a useless idea
JavaScript
3
star
44

trip-to-carbon-xyz

a light wrapper around triptocarbon.xyz
TypeScript
3
star
45

rename

interactive mv
Shell
2
star
46

ring-secure-headers

WIP: Ring (Clojure) security with HTTP headers.
Clojure
2
star
47

wren-querystring

querystring parser/stringifier for Wren
2
star
48

luluwrite

Pastebin + Medium. Abandoned. Add an issue if you want to take over!
Ruby
2
star
49

Recurry.js

abandoned. check out rrule.js
JavaScript
2
star
50

is-password-ok

is the password kinda ok
JavaScript
2
star
51

Content-Security-Policy-sandbox

a lil app for playing around with CSP
JavaScript
2
star
52

ring-tones

this name is a pun
CoffeeScript
2
star
53

hide-news-feed

hide the Facebook news feed in any browser. This project has been abandoned—please open an issue if you would like to take it over.
CSS
2
star
54

wren-vector3d

3D vectors for Wren
2
star
55

Fiesta.js

No longer maintained! See issues if you want to take over.
CoffeeScript
2
star
56

expecting.js

No longer maintained! See issues if you want to take over.
JavaScript
2
star
57

ticker

a lightweight wrapper on requestAnimationFrame
JavaScript
2
star
58

blooming-onion

a code doodle
CoffeeScript
2
star
59

lildash

NO LONGER MAINTAINED. Use 101.js.
JavaScript
2
star
60

airtable-clj

Clojure wrapper around the Airtable API (WIP)
Clojure
1
star
61

when-will-breath-of-the-wild-be-released

i want to know when the next Zelda comes out
JavaScript
1
star
62

Pingaling-for-Chrome

Monitor your network status from Chrome.
JavaScript
1
star
63

js1k-2016

fireworks!
HTML
1
star
64

mailtolink.js

make mailto: links
JavaScript
1
star
65

clone-github

clone all of a GitHub user's repositories
Ruby
1
star
66

toki-pona-to-hex

for fun
JavaScript
1
star
67

umpm

abandoned package manager for University of Michigan students. Add an issue if you want to take over the project!
Shell
1
star
68

startInterval

setInterval that starts immediately. made for a tutorial
JavaScript
1
star
69

who-are-you-on-facebook

proof of concept (WIP)
JavaScript
1
star
70

gopher-node-menudle

generate Gopher menus with Node. Abandoned. Add an issue if you want to take over!
JavaScript
1
star
71

Aubrey

turn any key-value store into a powerful collection (WIP)
JavaScript
1
star
72

MiniClass

tiny JavaScript classes. Abandoned. Add an issue if you want to take over!
JavaScript
1
star
73

JSTypes

Small JavaScript library that deals with variable types. Abandoned. Add an issue if you want to take over!
JavaScript
1
star
74

Circles-1K

Pretty circles in 1 kilobyte of JavaScript.
JavaScript
1
star
75

el-rando

command line tool to generate random stuff
Python
1
star
76

js1k-2015

pietime. won 10th place somehow
JavaScript
1
star
77

us-military-dj-names

us military operations make great DJ names
JavaScript
1
star
78

ExtJS-vs.-Sencha-Touch

Comparing the similar APIs of Sencha Touch and ExtJS.
JavaScript
1
star
79

patterns

make simple patterns that could be on a hipster shirt
JavaScript
1
star
80

Chucklehuck

Playing around with ChucK. Don't mind me.
1
star
81

truth-table

generate truth tables from the command line. made for a class
CoffeeScript
1
star
82

miniexpress

Express.js in under 50 lines. not for real use
JavaScript
1
star
83

nimi-mute

A Toki Pona dictionary.
JavaScript
1
star
84

xml-to-text

in goes the XML, out comes the plain text
Python
1
star
85

node-html-pack

inline styles and scripts and minify everything
JavaScript
1
star
86

oneatatime

don't execute an async function again until it's done (WIP)
JavaScript
1
star
87

js1k-2014

"dragon scales", my entry to js1k 2014
JavaScript
1
star
88

time-in-korea

a simple Android app that tells you the time in South Korea. Abandoned. Add an issue if you want to take over!
CSS
1
star
89

import-pinboard-to-standard-notes

a little web app to import Pinboard bookmarks into Standard Notes
JavaScript
1
star