We can't count on auth tokens being sent anymore, so we set the namespace and repository for the session when the original put on the repo is made.

This commit is contained in:
root 2013-12-09 04:24:29 +00:00
parent 8917812efa
commit 61618c7eab
2 changed files with 8 additions and 6 deletions

View file

@ -2,7 +2,7 @@ import json
import logging
import urlparse
from flask import request, make_response, jsonify, abort
from flask import request, make_response, jsonify, abort, session
from functools import wraps
from data import model
@ -25,6 +25,10 @@ def generate_headers(role='read'):
def wrapper(namespace, repository, *args, **kwargs):
response = f(namespace, repository, *args, **kwargs)
# Setting session namespace and repository
session['namespace'] = namespace
session['repository'] = repository
# We run our index and registry on the same hosts for now
registry_server = urlparse.urlparse(request.url).netloc
response.headers['X-Docker-Endpoints'] = registry_server