Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Joanne Hugé
slapos
Commits
434a7eef
Commit
434a7eef
authored
Jun 14, 2021
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
caddy-frontend: Support dropping headers from configuration
parent
5d2f2356
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
software/caddy-frontend/test/test.py
software/caddy-frontend/test/test.py
+6
-3
No files found.
software/caddy-frontend/test/test.py
View file @
434a7eef
...
@@ -527,8 +527,14 @@ class TestHandler(BaseHTTPRequestHandler):
...
@@ -527,8 +527,14 @@ class TestHandler(BaseHTTPRequestHandler):
status_code
=
int
(
config
.
pop
(
'status_code'
))
status_code
=
int
(
config
.
pop
(
'status_code'
))
timeout
=
int
(
config
.
pop
(
'Timeout'
,
'0'
))
timeout
=
int
(
config
.
pop
(
'Timeout'
,
'0'
))
compress
=
int
(
config
.
pop
(
'Compress'
,
'0'
))
compress
=
int
(
config
.
pop
(
'Compress'
,
'0'
))
drop_header_list
=
[]
for
header
in
config
.
pop
(
'X-Drop-Header'
,
''
).
split
():
drop_header_list
.
append
(
header
)
header_dict
=
config
header_dict
=
config
else
:
else
:
drop_header_list
=
[]
for
header
in
self
.
headers
.
dict
.
get
(
'x-drop-header'
,
''
).
split
():
drop_header_list
.
append
(
header
)
response
=
None
response
=
None
status_code
=
200
status_code
=
200
timeout
=
int
(
self
.
headers
.
dict
.
get
(
'timeout'
,
'0'
))
timeout
=
int
(
self
.
headers
.
dict
.
get
(
'timeout'
,
'0'
))
...
@@ -568,9 +574,6 @@ class TestHandler(BaseHTTPRequestHandler):
...
@@ -568,9 +574,6 @@ class TestHandler(BaseHTTPRequestHandler):
if
self
.
identification
is
not
None
:
if
self
.
identification
is
not
None
:
self
.
send_header
(
'X-Backend-Identification'
,
self
.
identification
)
self
.
send_header
(
'X-Backend-Identification'
,
self
.
identification
)
drop_header_list
=
[]
for
header
in
self
.
headers
.
dict
.
get
(
'x-drop-header'
,
''
).
split
():
drop_header_list
.
append
(
header
)
if
'Content-Type'
not
in
drop_header_list
:
if
'Content-Type'
not
in
drop_header_list
:
self
.
send_header
(
"Content-Type"
,
"application/json"
)
self
.
send_header
(
"Content-Type"
,
"application/json"
)
if
'Set-Cookie'
not
in
drop_header_list
:
if
'Set-Cookie'
not
in
drop_header_list
:
...
...
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