Allow trailing slashes on some routes

master 0.2.6
Drew DeVault 2 years ago
parent 69c60fb4c4
commit 216ca85b16
  1. 2
      hubsrht/app.py
  2. 2
      hubsrht/blueprints/projects.py
  3. 4
      hubsrht/blueprints/users.py

@ -27,4 +27,6 @@ class HubApp(SrhtFlask):
self.register_blueprint(users)
self.register_blueprint(webhooks)
self.url_map.strict_slashes = False
app = HubApp()

@ -12,7 +12,7 @@ from srht.validation import Validation, valid_url
projects = Blueprint("projects", __name__)
@projects.route("/<owner>/<project_name>")
@projects.route("/<owner>/<project_name>/")
def summary_GET(owner, project_name):
owner, project = get_project(owner, project_name, ProjectAccess.read)

@ -6,7 +6,7 @@ from srht.search import search_by
users = Blueprint("users", __name__)
@users.route("/~<username>")
@users.route("/~<username>/")
def summary_GET(username):
user = User.query.filter(User.username == username).first()
if not user:
@ -32,7 +32,7 @@ def summary_GET(username):
user=user, projects=projects, EventType=EventType, events=events,
**pagination)
@users.route("/projects/<owner>")
@users.route("/projects/<owner>/")
def projects_GET(owner):
if owner.startswith("~"):
owner = owner[1:]

Loading…
Cancel
Save