Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 29474653: Remove trailing slashes from file URLs in web::server class (Closed)

Created:
June 26, 2017, 8:17 p.m. by mathias
Modified:
July 6, 2017, 11:57 a.m.
Reviewers:
Wladimir Palant
CC:
Fred, juliandoucette, f.lopez, f.nicolaisen
Visibility:
Public.

Description

Remove trailing slashes from file URLs in web::server class

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -0 lines) Patch
M modules/web/templates/site.conf.erb View 1 chunk +7 lines, -0 lines 4 comments Download

Messages

Total messages: 3
mathias
June 26, 2017, 8:18 p.m. (2017-06-26 20:18:02 UTC) #1
Wladimir Palant
Is it a good idea to have this land without an issue? It's not a ...
June 26, 2017, 10:20 p.m. (2017-06-26 22:20:47 UTC) #2
mathias
June 27, 2017, 10:04 a.m. (2017-06-27 10:04:01 UTC) #3
On 2017/06/26 22:20:47, Wladimir Palant wrote:
> Is it a good idea to have this land without an issue? It's not a trivial
change.

No idea what a ticket could improve here. The intended commit message is pretty
straightforward, and the patch-set is as well. Don't get me wrong, I am
definitely not against having tickets, I just wonder how subsequently creating
one now has any benefit. Isn't there a ticket for the issues which lead to this
one?

https://codereview.adblockplus.org/29474653/diff/29474654/modules/web/templat...
File modules/web/templates/site.conf.erb (right):

https://codereview.adblockplus.org/29474653/diff/29474654/modules/web/templat...
modules/web/templates/site.conf.erb:52: if (!-d "$document_root/$uri")
On 2017/06/26 22:20:47, Wladimir Palant wrote:
> You probably want to do this only for actual files, not just for any input
that might [not] be a directory.

In fact i wanted to explicitly express that this is done "for anything but
directories", in contrast to Nginx behavior for serving directories. But you're
right: The current version would also match absent resources, which in turn
could lead to some overhead with invalid requests and issues with i.e. FCGI
backends.

https://codereview.adblockplus.org/29474653/diff/29474654/modules/web/templat...
modules/web/templates/site.conf.erb:54: rewrite ^(/.*)/$ $1 redirect;
On 2017/06/26 22:20:47, Wladimir Palant wrote:
> [...] maybe redirect with a "?no_redirect" added to the URL?

Acknowledged.

Powered by Google App Engine
This is Rietveld