-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.ru
More file actions
46 lines (31 loc) · 1.03 KB
/
config.ru
File metadata and controls
46 lines (31 loc) · 1.03 KB
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
36
37
38
39
40
41
42
43
44
45
46
require "rubygems"
require "bundler/setup"
require "unxf"
require "clogger"
require "rack/contrib"
require_relative "server"
# Tell Sinatra we don't want json_csrf protection since it causes a
# 403 Forbidden when fetching /visit and the referer is not the host.
# Sinatra (or something) installs protection when
# RACK_ENV="production".
set :protection, except: [:json_csrf]
# Remove "HTTP_X_FORWARDED_FOR" in the Rack environment and replace
# "REMOTE_ADDR" with the value of the original client address.
use UnXF
# Disable Sinatra logging.
disable :logging
# Use the Apache combined log format. Sinatra logging will be disabled.
use Clogger,
logger: $stderr,
format: :Combined,
reentrant: true
# Use session cookies (no need to enable in Sinatra).
#use Rack::Session::Cookie,
# key: settings.name,
# path: "/",
# expire_after: 10*365*86400,
# secret: settings.secret
# Add JSON-P support by stripping out the callback param and padding
# the response with the appropriate callback format.
use Rack::JSONP
run Sinatra::Application