Commit 1b60cfa0 authored by iv's avatar iv

Fix double slash by using urljoin.

parent e8eaa8d3
...@@ -2,6 +2,7 @@ from itsdangerous import Signer, base64_encode, base64_decode ...@@ -2,6 +2,7 @@ from itsdangerous import Signer, base64_encode, base64_decode
from flask import Flask, request, render_template, make_response, g from flask import Flask, request, render_template, make_response, g
from flask.views import MethodView from flask.views import MethodView
import urlparse
import shutil import shutil
import utils import utils
import os import os
...@@ -83,9 +84,9 @@ def before_request(): ...@@ -83,9 +84,9 @@ def before_request():
response = make_response(content, 200) response = make_response(content, 200)
response.headers = headers response.headers = headers
else: else:
headers['WWW-Authenticate'] = \ headers['WWW-Authenticate'] = 'Nayookie login_url=' + \
'Nayookie login_url=' + request.url_root + \ urlparse.urljoin(request.url_root,
URI_BEGINNING_PATH['authorization'] + '{?back_url}' URI_BEGINNING_PATH['authorization']) + '{?back_url}'
response = make_response(content, 401) response = make_response(content, 401)
response.headers = headers response.headers = headers
# do not handle the request if not authorized # do not handle the request if not authorized
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment