-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.ru
35 lines (26 loc) · 915 Bytes
/
config.ru
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# frozen_string_literal: true
require "rack/protection"
require_relative "lib/frampt"
require_relative "lib/frampt/const"
# fetch stuff from .env if we are running locally
unless Frampt::Const::PRODUCTION
require "dotenv/load"
require "debug"
end
# use cookies for session data
# we dont have user accounts, but still might be
# useful to have some state for something
use Rack::Session::Cookie, secret: ENV.fetch("SESSION_COOKIE_SECRET"), key: "framptsesh"
use Rack::Protection
# CSRF protection
use Rack::Protection::AuthenticityToken
use Rack::Protection::FormToken
use Rack::Protection::RemoteReferrer
# XSS protection
use Rack::Protection::EscapedParams
# cookie tossing lmao i love that one
# what does it even mean to toss a cookie KA BAM toss that shit LOL
use Rack::Protection::CookieTossing
# protocol downgrade attack and cookie hijacks
use Rack::Protection::StrictTransport
run Frampt::App