Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LQDN Adminsys
generateur-slogans
Commits
833f83a8
Verified
Commit
833f83a8
authored
Nov 15, 2017
by
Thibaut Broggi
Browse files
Use "trust proxy" in express
parent
9a129ce5
Changes
1
Hide whitespace changes
Inline
Side-by-side
srv.js
View file @
833f83a8
...
...
@@ -9,6 +9,7 @@ const app = express();
const
config
=
require
(
'
./config.json
'
);
const
i18n
=
require
(
'
./i18n.js
'
);
app
.
set
(
'
trust proxy
'
,
true
);
app
.
set
(
'
x-powered-by
'
,
false
);
app
.
set
(
'
view engine
'
,
'
pug
'
);
app
.
use
(
express
.
static
(
'
./static
'
));
...
...
@@ -99,7 +100,7 @@ function tweetMessage(req) {
+
encodeURIComponent
(
'
La Quadrature du Net ! #LQDoN
'
)
+
encodeURIComponent
(
req
.
protocol
+
"
://
"
+
req
.
headers
.
host
)
+
'
'
+
encodeURIComponent
(
buildUrl
(
req
))
;
+
encodeURIComponent
(
buildUrl
(
req
));
}
app
.
get
(
'
/generate.png
'
,
function
(
req
,
res
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment