+ # If we target a directory without an ending `/`,
+ # redirect to the directory ending with `/`.
+ if not request.uri.is_empty and
+ request.uri.chars.last != '/' then
+ response = new HttpResponse(303)
+ response.header["Location"] = request.uri + "/"
+ return response
+ end
+
+ # Show index file instead of the directory listing
+ # only if `index.html` or `index.htm` is available