0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-23 22:27:38 -05:00
caddy/caddyhttp
Matt Holt d5371aff22 httpserver/all: Clean up and standardize request URL handling (#1633)
* httpserver/all: Clean up and standardize request URL handling

The HTTP server now always creates a context value on the request which
is a copy of the request's URL struct. It should not be modified by
middlewares, but it is safe to get the value out of the request and make
changes to it locally-scoped. Thus, the value in the context always
stores the original request URL information as it was received. Any
rewrites that happen will be to the request's URL field directly.

The HTTP server no longer cleans /sanitizes the request URL. It made too
many strong assumptions and ended up making a lot of middleware more
complicated, including upstream proxying (and fastcgi). To alleviate
this complexity, we no longer change the request URL. Middlewares are
responsible to access the disk safely by using http.Dir or, if not
actually opening files, they can use httpserver.SafePath().

I'm hoping this will address issues with #1624, #1584, #1582, and others.

* staticfiles: Fix test on Windows

@abiosoft: I still can't figure out exactly what this is for. 😅

* Use (potentially) changed URL for browse redirects, as before

* Use filepath.ToSlash, clean up a couple proxy test cases

* Oops, fix variable name
2017-05-01 23:11:10 -06:00
..
basicauth Added Const for use of CtxKeys (#1511) 2017-03-13 09:22:46 -06:00
bind Refactor how caddy.Context is stored and used 2016-06-20 11:59:23 -06:00
browse httpserver/all: Clean up and standardize request URL handling (#1633) 2017-05-01 23:11:10 -06:00
errors Roll all logs by default (#1379) 2017-02-08 09:23:33 -07:00
expvar Refactor how caddy.Context is stored and used 2016-06-20 11:59:23 -06:00
extensions httpserver/all: Clean up and standardize request URL handling (#1633) 2017-05-01 23:11:10 -06:00
fastcgi httpserver/all: Clean up and standardize request URL handling (#1633) 2017-05-01 23:11:10 -06:00
gzip proxy: recognize client's cancellation 2017-04-30 10:14:19 +08:00
header proxy: recognize client's cancellation 2017-04-30 10:14:19 +08:00
httpserver httpserver/all: Clean up and standardize request URL handling (#1633) 2017-05-01 23:11:10 -06:00
index caddyhttp: New index directive for alternate index file names (#1567) 2017-04-17 11:02:44 -06:00
internalsrv internal: inherit original ResponseWriter's interfaces 2017-05-02 10:53:16 +08:00
log log: only allow new roller related options in a block 2017-04-17 16:55:45 +08:00
markdown context: add Push action 2017-04-27 09:51:33 +08:00
maxrequestbody Add maxrequestbody directive (#1163) 2016-11-04 08:25:49 +08:00
mime Refactor how caddy.Context is stored and used 2016-06-20 11:59:23 -06:00
pprof pprof: Set proper Content-Type header 2017-01-24 16:55:43 -07:00
proxy httpserver/all: Clean up and standardize request URL handling (#1633) 2017-05-01 23:11:10 -06:00
push push: Reorder before proxy; and allow zero arguments (cf. #1573) 2017-04-17 22:06:17 -06:00
redirect httpserver/all: Clean up and standardize request URL handling (#1633) 2017-05-01 23:11:10 -06:00
rewrite httpserver/all: Clean up and standardize request URL handling (#1633) 2017-05-01 23:11:10 -06:00
root fixing panic when root is symlink (#1429) 2017-02-15 22:02:51 -07:00
staticfiles httpserver/all: Clean up and standardize request URL handling (#1633) 2017-05-01 23:11:10 -06:00
status Add 'status' middleware instead of 'status' directive for 'rewrite' middleware 2016-08-29 17:17:23 +03:00
templates context: add Push action 2017-04-27 09:51:33 +08:00
timeouts New 'timeouts' directive to configure timeouts; default timeouts enabled (#1368) 2017-01-24 08:15:25 -07:00
websocket Fix misspellings 2016-09-05 10:20:34 -06:00
caddyhttp.go caddyhttp: New index directive for alternate index file names (#1567) 2017-04-17 11:02:44 -06:00
caddyhttp_test.go caddyhttp: New index directive for alternate index file names (#1567) 2017-04-17 11:02:44 -06:00