ensure trailing slashes in all routes
This commit is contained in:
@@ -5,7 +5,7 @@ import math
|
||||
|
||||
bp = Blueprint('threads', __name__, url_prefix='/threads/')
|
||||
|
||||
@bp.get('/<slug>')
|
||||
@bp.get('/<slug>/')
|
||||
def thread(slug):
|
||||
thread = Threads.find({'slug': slug})
|
||||
if not thread:
|
||||
@@ -34,7 +34,7 @@ def thread(slug):
|
||||
abort(404)
|
||||
return render_template('threads/thread.html', thread=thread, posts=thread.get_posts(PER_PAGE, page), page=page, page_count=page_count, topic=topic, started_by=started_by, topics=Topics.get_list(), Reactions=Reactions)
|
||||
|
||||
@bp.post('/<slug>/reply')
|
||||
@bp.post('/<slug>/reply/')
|
||||
@login_required
|
||||
def reply(slug):
|
||||
user = get_active_user()
|
||||
@@ -47,7 +47,7 @@ def reply(slug):
|
||||
post = Posts.new(user.id, thread.id, request.form.get('babycode_content'))
|
||||
return redirect(url_for('.thread', slug=slug, after=post.id, _anchor=f'post-{post.id}'))
|
||||
|
||||
@bp.get('/<slug>/feed.atom')
|
||||
@bp.get('/<slug>/feed.atom/')
|
||||
def feed(slug):
|
||||
return 'stub'
|
||||
|
||||
@@ -61,7 +61,7 @@ def new():
|
||||
selected_topic = None
|
||||
return render_template('threads/new_thread.html', topics=topics, selected_topic=selected_topic)
|
||||
|
||||
@bp.post('/new')
|
||||
@bp.post('/new/')
|
||||
@login_required
|
||||
def new_post():
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user