Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
re6stnet
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nicolas Wavrant
re6stnet
Commits
7cdf00d7
Commit
7cdf00d7
authored
Dec 17, 2014
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
registry: fix security of some RPC when serving behind proxy
parent
3b5d03e4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
re6st/registry.py
re6st/registry.py
+7
-4
No files found.
re6st/registry.py
View file @
7cdf00d7
...
@@ -161,10 +161,13 @@ class RegistryServer(object):
...
@@ -161,10 +161,13 @@ class RegistryServer(object):
# (IOW, do the contrary of newPrefix)
# (IOW, do the contrary of newPrefix)
self
.
timeout
=
not_after
and
not_after
+
GRACE_PERIOD
self
.
timeout
=
not_after
and
not_after
+
GRACE_PERIOD
def
handle_request
(
self
,
request
,
method
,
kw
):
def
handle_request
(
self
,
request
,
method
,
kw
,
_localhost
=
(
'127.0.0.1'
,
'::1'
)):
m
=
getattr
(
self
,
method
)
m
=
getattr
(
self
,
method
)
if
method
in
(
'versions'
,
'topology'
,)
and
\
if
method
in
(
'versions'
,
'topology'
):
request
.
client_address
[
0
]
not
in
(
'127.0.0.1'
,
'::1'
):
x_forwarded_for
=
request
.
headers
.
get
(
'X-Forwarded-For'
)
if
request
.
client_address
[
0
]
not
in
_localhost
or
\
x_forwarded_for
and
x_forwarded_for
not
in
_localhost
:
return
request
.
send_error
(
httplib
.
FORBIDDEN
)
return
request
.
send_error
(
httplib
.
FORBIDDEN
)
key
=
m
.
getcallargs
(
**
kw
).
get
(
'cn'
)
key
=
m
.
getcallargs
(
**
kw
).
get
(
'cn'
)
if
key
:
if
key
:
...
...
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