Use request.path instead of url for endswith conditions.
Because of the query string
This commit is contained in:
parent
db63ccc641
commit
ca74e2e1d4
2 changed files with 2 additions and 2 deletions
|
@ -20,7 +20,7 @@ def get_tags_specific_redirect(specific_tag):
|
|||
@site.route('/tagid/<tag_id>')
|
||||
@site.route('/tagid/<tag_id>.json')
|
||||
def get_tag_id_redirect(tag_id):
|
||||
if request.url.endswith('.json'):
|
||||
if request.path.endswith('.json'):
|
||||
tag = common.P_tag_id(tag_id, response_type='json')
|
||||
else:
|
||||
tag = common.P_tag_id(tag_id, response_type='html')
|
||||
|
|
|
@ -26,7 +26,7 @@ def get_user_json(username):
|
|||
@site.route('/userid/<user_id>')
|
||||
@site.route('/userid/<user_id>.json')
|
||||
def get_user_id_redirect(user_id):
|
||||
if request.url.endswith('.json'):
|
||||
if request.path.endswith('.json'):
|
||||
user = common.P_user_id(user_id, response_type='json')
|
||||
else:
|
||||
user = common.P_user_id(user_id, response_type='html')
|
||||
|
|
Loading…
Reference in a new issue