Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
P
paas2-auth-sidecar
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ASM
paas2-auth-sidecar
Commits
8023b2d5
Commit
8023b2d5
authored
Apr 05, 2017
by
Olav Morken
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix secure cookie set for http requests.
parent
66eea123
Pipeline
#1664
passed with stage
in 2 minutes and 56 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
lua/callback.lua
lua/callback.lua
+11
-1
No files found.
lua/callback.lua
View file @
8023b2d5
local
headers
=
ngx
.
req
.
get_headers
()
local
scheme
=
headers
[
"x-forwarded-proto"
]
if
not
scheme
then
scheme
=
ngx
.
var
.
scheme
end
local
secure_flag
=
'Secure; '
if
scheme
==
'http'
then
secure_flag
=
''
end
ngx
.
req
.
read_body
()
local
args
,
err
=
ngx
.
req
.
get_post_args
()
if
not
args
then
...
...
@@ -8,5 +18,5 @@ end
local
session
=
args
[
'SessionId'
]
local
returnTo
=
args
[
'ReturnTo'
]
ngx
.
header
[
'Set-Cookie'
]
=
'session='
..
session
..
'; path=/;
Secure;
HttpOnly;'
ngx
.
header
[
'Set-Cookie'
]
=
'session='
..
session
..
'; path=/;
'
..
secure_flag
..
'
HttpOnly;'
return
ngx
.
redirect
(
returnTo
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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