Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Issue #1120 - Add status code 301 and redirect url for /issues/catego…
…ry/new to /issues/category/needstriage, /issues/search/new to /issues/search/needtriage
  • Loading branch information
deepthivenkat committed Jul 13, 2016
commit b6c9a636354eec3dc1cb112499d8f1c00fb98396
8 changes: 6 additions & 2 deletions webcompat/api/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
from flask import abort
from flask import Blueprint
from flask import g
from flask import redirect
from flask import request
from flask import session
from flask import url_for

from webcompat import app
from webcompat import limiter
Expand Down Expand Up @@ -128,7 +130,8 @@ def get_issue_category(issue_category):
# For paginated results on the /issues page,
# see /issues/search/needstriage.
elif issue_category == 'new':
abort(301)
redirect(url_for('.get_issue_category',
issue_category='needstriage'), 301)

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

else:
# The path doesn’t exist. 404 Not Found.
abort(404)
Expand Down Expand Up @@ -189,7 +192,8 @@ def get_category_from_search(issue_category):
query_string += ' state:closed '
return get_search_results(query_string, params)
elif issue_category == 'new':
abort(301)
redirect(url_for('.get_category_from_search',
issue_category='needstriage'), 301)
else:
# no known keyword we send not found
abort(404)
Expand Down