Skip to content
This repository was archived by the owner on Sep 12, 2018. It is now read-only.

Commit 3faf029

Browse files
committed
Change standalone header when in mirroring mode (prevents client from sending basic auth headers and overwriting token)
1 parent ea6e568 commit 3faf029

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

docker_registry/app.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@
2727
@app.route('/_ping')
2828
@app.route('/v1/_ping')
2929
def ping():
30-
return toolkit.response(headers={
31-
'X-Docker-Registry-Standalone': cfg.standalone is not False
32-
})
30+
headers = {'X-Docker-Registry-Standalone': cfg.standalone is not False}
31+
if cfg.mirroring:
32+
headers['X-Docker-Registry-Standalone'] = 'mirror'
33+
return toolkit.response(headers=headers)
3334

3435

3536
@app.route('/')

0 commit comments

Comments
 (0)