# HG changeset patch # User Christophe de Vienne # Date 1471625894 -7200 # Node ID bdfacbcf700e581b54707e5c8c69e11cac5340ec # Parent acf857ef0abe481e0c7db122dad15d8dcfd52242 Friendlier patch urls & mimetype Replace /changeset//patch/ by /changeset/.patch and set the mimetype to text/x-diff. This helps the browser opening the right application thanks to the mimetype, and the application to better guess the file type thanks to the '.patch' extension diff -r acf857ef0abe -r bdfacbcf700e review/templates/changeset.html --- a/review/templates/changeset.html Fri Dec 12 11:17:43 2014 +0100 +++ b/review/templates/changeset.html Fri Aug 19 18:58:14 2016 +0200 @@ -25,7 +25,7 @@ {% block content %}
 
- +

{{ rev.rev() }}: diff -r acf857ef0abe -r bdfacbcf700e review/web.py --- a/review/web.py Fri Dec 12 11:17:43 2014 +0100 +++ b/review/web.py Fri Aug 19 18:58:14 2016 +0200 @@ -213,7 +213,7 @@ newer=newer, older=older) -@app.route('/changeset//patch/') +@app.route('/changeset/.patch') def patch(revhash): result = StringIO.StringIO() try: @@ -224,7 +224,7 @@ abort(404) except UnicodeEncodeError: abort(404) - return Response(result.getvalue(), content_type="application/octet-stream") + return Response(result.getvalue(), content_type="text/x-patch") @app.route('/pull/', methods=['POST']) def pull():