summaryrefslogtreecommitdiff
path: root/modules/caddyhttp
AgeCommit message (Collapse)Author
2020-07-20fastcgi: Add resolve_root_symlink (#3587)Manuel Dalla Lana
2020-07-20reverse_proxy: flush HTTP/2 response when ContentLength is unknown (#3561)Kevin Lin
* reverse proxy: Support more h2 stream scenarios (#3556) * reverse proxy: add integration test for better h2 stream (#3556) * reverse proxy: adjust comments as francislavoie suggests * link to issue #3556 in the comments
2020-07-18reverseproxy: add support for custom DNS resolver (#3479)Mohammed Al Sahaf
* reverse proxy: add support for custom resolver * reverse proxy: don't pollute the global resolver with bootstrap resolver setup * Improve documentation of reverseproxy.UpstreamResolver fields Co-authored-by: Matt Holt <mholt@users.noreply.github.com> * reverse proxy: clarify the name resolution conventions of upstream resolvers and bootstrap resolver * remove support for bootstraper of resolver * godoc and code-style changes Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
2020-07-17reverseproxy: Restore request's original host and header (fix #3509)Matthew Holt
We already restore them within the retry loop, but after successful proxy we didn't reset them, so as handlers bubble back up, they would see the values used for proxying. Thanks to @ziddey for identifying the cause.
2020-07-17fastcgi: Ensure leading slash, omit SERVER_PORT if empty for compliance (#3570)Francis Lavoie
See https://tools.ietf.org/html/rfc3875#section-4.1.13 for SCRIPT_NAME requiring leading slash See https://tools.ietf.org/html/rfc3875#section-4.1.15 for SERVER_PORT requiring omission if empty
2020-07-17fastcgi: Fill REMOTE_USER with http.auth.user.id placeholder (#3577)Francis Lavoie
Completing a TODO!
2020-07-17reverseproxy: Fix Caddyfile parsing for empty non-http transports (#3576)Francis Lavoie
* reverseproxy: Fix Caddyfile parsing for empty non-http transports * Update modules/caddyhttp/reverseproxy/caddyfile.go Co-authored-by: Matt Holt <mholt@users.noreply.github.com> * Rename empty transport test Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
2020-07-17caddyauth: hash-password: Set bcrypt cost to 14 (#3580)Matthew Holt
2020-07-16caddyhttp: Add {http.request.body} placeholderMatthew Holt
2020-07-08fileserver: Enable browse pagination with offset parameter (#3542)snu-ceyda
* Update browse.go * Update browselisting.go * Update browsetpl.go * fix linter err * Update modules/caddyhttp/fileserver/browse.go Co-authored-by: Matt Holt <mholt@users.noreply.github.com> * Update modules/caddyhttp/fileserver/browselisting.go Co-authored-by: Matt Holt <mholt@users.noreply.github.com> * Update browsetpl.go change from -> offset * Update browse.go * Update browselisting.go Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
2020-07-08templates: Fix front matter closing fence searchMatthew Holt
This makes it choose first matching closing fence instead of last one, which could appear in document body.
2020-07-07caddyhttp: Reorder some access log fields; add host matcher test caseMatthew Holt
This field order reads a little more naturally.
2020-07-06templates: Disable hard wraps in Markdown rendering (#3553)Greg Anders
2020-06-30cel: fix validation of expression result type (#3526)Mohammed Al Sahaf
* cel: fix validation of expression result type The earlier code used the proto.Equals from github.com/gogo/protobuf, which failed to compare two messages of the same type for some reason. Switching to proto.Equal from the canonical github.com/golang/protobuf fixes the issue. * deps: remove deprecated github.com/golang/protobuf in favor of google.golang.org/protobuf * downgrade github.com/smallstep/nosql to resolve warning pb.proto warning
2020-06-30caddyhttp: Corrected host label index check (fix #3502)Matthew Holt
2020-06-26caddyhttp: Support placeholders in query matcher (#3521)James Birtles
2020-06-26caddyhttp: Add 'map' handler (#3199)Mark Sargent
* inital map implementation * resolve the value during middleware execution * use regex instead * pr feedback * renamed mmap to maphandler * refactored GetString implementation * fixed mispelling * additional feedback
2020-06-26caddyhttp: Better host matching for logger names (fix #3488) (#3522)Matt Holt
First try an exact lookup like before, but if it fails, strip the port and try again. example.com:1234 should still use a logger keyed for example.com if there is no key example.com:1234.
2020-06-22fastcgi: Fix php_fastcgi matcher regression (#3512)Francis Lavoie
2020-06-22chore: Fix typo in reverse-proxy subcommand help message (#3513)Xiuming Chen
2020-06-16caddyhttp: Empty, not nil, query matcher matches empty query stringMatthew Holt
2020-06-16caddyhttp: Enable matching empty query stringMatthew Holt
Caddyfile syntax: query "" Or a nil matcher in the JSON should also match an empty query string. See https://caddy.community/t/v2-match-empty-query/8708?u=matt
2020-06-15templates: Add support for dots to close yaml frontmatter (#3498)Francis Lavoie
* templates: Add support for dots to close yaml frontmatter * templates: Fix regression in body output
2020-06-12fastcgi: Make sure splitPos handles empty SplitPath correctly (#3491)Wynn Wolf Arbor
In commit f2ce81c, support for multiple path splitters was added. The type of SplitPath changed from string to []string, and splitPos was changed to loop through all values in SplitPath. Before that commit, if SplitPath was empty, strings.Index returned 0 and PATH_INFO was set correctly in buildEnv. Currently, however, splitPos returns -1 for empty values of SplitPath, behaving as if a split position could not be found at all. PATH_INFO is then never set in buildEnv and remains empty. Restore the old behaviour by explicitly checking whether SplitPath is empty and returning 0 in splitPos. Closes #3490
2020-06-11caddyhttp: Add client cert SAN placeholdersMatthew Holt
2020-06-11reverseproxy: Close websocket conn if req context cancelsMatthew Holt
This is a recent patch in the Go standard library
2020-06-08reverseproxy: Add Caddyfile support for ClientCertificateAutomateMatthew Holt
2020-06-04reverseproxy: Enable changing only the status code (close #2920)Matthew Holt
2020-06-04caddyhttp: Default to error status if found in contextMatthew Holt
This is just a convenience if using a static_response handler in an error route, by setting the default status code to the same one as the error status.
2020-06-03caddyhttp: Auto-redirects from all bind addresses (fix #3443)Matthew Holt
2020-06-01caddyauth: Cache basicauth results (fixes #3462) (#3465)Matt Holt
Cache capacity is currently hard-coded at 1000 with random eviction. It is enabled by default from Caddyfile configurations because I assume this is the most common preference.
2020-05-27reverseproxy: Pool copy buffers (minor optimization)Matthew Holt
2020-05-27reverseproxy: Enable response interception (#1447, #2920)Matthew Holt
It's a raw, low-level implementation for now, but it's very flexible. More sugar-coating can be added after error handling is more developed.
2020-05-26caddyhttp: Refactor header matchingMatthew Holt
This allows response matchers to benefit from the same matching logic as the request header matchers (mainly prefix/suffix wildcards).
2020-05-26caddyhttp: Add client.public_key(_sha256) placeholdersMatthew Holt
2020-05-26httpcaddyfile: New `handle_path` directive (#3281)Francis Lavoie
* caddyconfig: WIP implementation of handle_path * caddyconfig: Complete the implementation - h.NewRoute was key * caddyconfig: Add handle_path integration test * caddyhttp: Use the path matcher as-is, strip the trailing *, update test
2020-05-26cmd: file-server: add --access-log flag (#3454)Rui Lopes
2020-05-26reverseproxy: Improve error message when using scheme+placeholder (#3393)Francis Lavoie
* reverseproxy: Improve error message when using scheme+placeholder * reverseproxy: Simplify error message Co-authored-by: Matt Holt <mholt@users.noreply.github.com> Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
2020-05-26reverseproxy: Fix https active health checks #3450 (#3451)AndyBan
2020-05-25chore: forego the use of deprecated cel func NewIdent in favor of NewVar (#3444)Mohammed Al Sahaf
2020-05-21caddyhttp: Add time.now placeholder and update cel-go (closes #2594)Matthew Holt
2020-05-21cmd: hash-password: Fix broken terminal state on SIGINT (#3416)Francis Lavoie
* caddyauth: Fix hash-password broken terminal state on SIGINT * caddycmd: Move TrapSignals calls to only subcommands that run long
2020-05-20reverseproxy: Don't overwrite existing X-Forwarded-Proto headerMatthew Holt
Correct behavior is not well defined because this is a non-standard header field. This could be a "hop-by-hop" field much like X-Forwarded-For is, but even our X-Forwarded-For implementation preserves prior entries. Or, it could be best to preserve the original value from the first hop, representing the protocol as facing the client. Let's try it the other way for a bit and see how it goes. See https://caddy.community/t/caddy2-w-wordpress-behind-nginx-reverse-proxy/8174/3?u=matt
2020-05-18reverseproxy: Make debug log safe if error occursMatthew Holt
2020-05-18reverseproxy: Emit debug log before checking error (#3425)Matthew Holt
This way the upstream request will always be available even if it failed
2020-05-18templates: trim windows whitespace in SplitFrontMatter; fix #3386 (#3387)Thorkild Gregersen
* add test case for SplitFrontMatter showing issue with windows newline * fix issue with windows newline when using SplitFrontMatter * Update modules/caddyhttp/templates/frontmatter.go Co-authored-by: Francis Lavoie <lavofr@gmail.com> * make it mere explicit what is trimmed from firstLine * Update modules/caddyhttp/templates/frontmatter.go Co-authored-by: Francis Lavoie <lavofr@gmail.com> Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
2020-05-18caddyauth: Add realm to basicauth Caddyfile directive (#3315)Francis Lavoie
2020-05-18fastcgi: `php_fastcgi` subdirectives to override shortcut behaviour (#3255)Francis Lavoie
* fastcgi: Add new php_fastcgi subdirectives to override the shortcut * fastcgi: Support "index off" to disable redir and try_files * fastcgi: Remove whitespace to satisfy linter * fastcgi: Run gofmt * fastcgi: Make a new dispenser instead of using rewind * fastcgi: Some fmt * fastcgi: Add a couple adapt tests * fastcgi: Clean up for loops * fastcgi: Move adapt tests to separate files
2020-05-13docs: link to CEL standard definitions (#3407)Mohammed Al Sahaf
* docs: link to CEL standard definitions * Rephrase the anchor to CEL standard definitions Co-authored-by: Matt Holt <mholt@users.noreply.github.com> Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
2020-05-13reverseproxy: Apply response header ops before copying it (fix #3382) (#3401)Matt Holt