summaryrefslogtreecommitdiff
path: root/modules/caddyhttp
AgeCommit message (Collapse)Author
2022-09-08Very minor tweaksMatthew Holt
2022-09-07fileserver: Ignore EOF when browsing empty dirMatthew Holt
Thanks to @WeidiDeng for reporting this
2022-09-07caddyhttp: ensure ResponseWriterWrapper and ResponseRecorder use ReadFrom if ↵fleandro
the underlying response writer implements it. (#5022) Doing so allows for splice/sendfile optimizations when available. Fixes #4731 Co-authored-by: flga <flga@users.noreply.github.com> Co-authored-by: Matthew Holt <mholt@users.noreply.github.com>
2022-09-05Drop requirement for filesystems to implement fs.StatFSDave Henderson
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
2022-09-05fileserver: Support glob expansion in file matcher (#4993)Matt Holt
* fileserver: Support glob expansion in file matcher * Fix tests * Fix bugs and tests * Attempt Windows fix, sigh * debug Windows, WIP * Continue debugging Windows * Another attempt at Windows * Plz Windows * Cmon... * Clean up, hope I didn't break anything
2022-09-05caddyhttp: Support `respond` with HTTP 103 Early Hints (#5006)Matt Holt
* caddyhttp: Support sending HTTP 103 Early Hints This adds support for early hints in the static_response handler. * caddyhttp: Don't record 1xx responses
2022-09-05Remove unnecessary error checkMatthew Holt
2022-09-05caddyauth: Speed up basicauth provision, deprecate scrypt (#4720)Francis Lavoie
* caddyauth: Speed up basicauth provisioning, precalculate fake password * Deprecate scrypt, allow using decoded bcrypt hashes * Add TODO note Co-authored-by: Matt Holt <mholt@users.noreply.github.com> Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
2022-09-02reverseproxy: Close hijacked conns on reload/quit (#4895)Matt Holt
* reverseproxy: Close hijacked conns on reload/quit We also send a Close control message to both ends of WebSocket connections. I have tested this many times in my dev environment with consistent success, although the variety of scenarios was limited. * Oops... actually call Close() this time * CloseMessage --> closeMessage Co-authored-by: Francis Lavoie <lavofr@gmail.com> * Use httpguts, duh * Use map instead of sync.Map Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2022-09-02core: Refactor listeners; use SO_REUSEPORT on Unix (#4705)Matt Holt
* core: Refactor listeners; use SO_REUSEPORT on Unix Just an experiment for now * Fix lint by logging error * TCP Keepalive configuration (#4865) * initial attempt at TCP Keepalive configuration * core: implement tcp-keepalive for linux * move canSetKeepAlive interface * Godoc for keepalive server parameter * handle return values * log keepalive errors * Clean up after bad merge * Merge in pluggable network types From 1edc1a45e3aee1f7d86b68c3ddaf2fd16ba8ab73 * Slight refactor, fix from recent merge conflict Co-authored-by: Karmanyaah Malhotra <karmanyaah.gh@malhotra.cc>
2022-09-02fastcgi: Optimize FastCGI transport (#4978)WeidiDeng
* break up code and use lazy reading and pool bufio.Writer * close underlying connection when operation failed * allocate bufWriter and streamWriter only once * refactor record writing * rebase from master * handle err * Fix type assertion Also reduce some duplication * Refactor client and clientCloser for logging Should reduce allocations * Minor cosmetic adjustments; apply Apache license * Appease the linter Co-authored-by: Matthew Holt <mholt@users.noreply.github.com>
2022-09-02Minor style adjustments for HTTP redir loggingMatthew Holt
2022-09-01templates: Document `httpError` function (#4972)Avdhut
* added the httpError function into the document * Update templates.go * Update templates.go * Fix gofmt Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
2022-09-02fastcgi: allow users to log stderr output (#4967) (#5004)fleandro
Co-authored-by: flga <flga@users.noreply.github.com>
2022-09-01caddyhttp: Copy logger config to HTTP server during AutoHTTPS (#4990)Francis Lavoie
2022-09-01map: Coerce val to string, fix #4987Matthew Holt
Also prevent infinite recursion, and enforce placeholder syntax.
2022-09-01caddyhttp: Accept placeholders in vars matcher keyMatthew Holt
Until now, the vars matcher has unintentionally lacked parity with the map directive: the destination placeholders of the map directive would be expressed as placeholders, i.e. {foo}. But the vars matcher would not use { }: vars foo value This looked weird, and was confusing, since it implied that the key could be dynamic, which doesn't seem helpful here. I think this is a proper bug fix, since we're not used to accessing placeholders literally without { } in the Caddyfile.
2022-09-01core: Plugins can register listener networks (#5002)Matt Holt
* core: Plugins can register listener networks This can be useful for custom listeners. This feature/API is experimental and may change! * caddyhttp: Expose server listeners
2022-08-31caddyhttp: Disable draft versions of QUICMatthew Holt
See comment in #4996
2022-08-31events: Implement event system (#4912)Francis Lavoie
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
2022-08-31caddyhttp: Set Content-Type for static response (#4999)Matt Holt
2022-08-29Minor cleanup, resolve a couple lint warningsMatthew Holt
2022-08-27Remove duplicate words in comments (#4986)Abirdcfly
2022-08-27reverseproxy: Add upstreams healthy metrics (#4935)Dávid Szabó
2022-08-25reverseproxy: Multiple dynamic upstreamsMatthew Holt
This allows users to, for example, get upstreams from multiple SRV endpoints in order (such as primary and secondary clusters). Also, gofmt went to town on the comments, sigh
2022-08-25Fix comment indentationMatthew Holt
2022-08-25zstd: fix typo in comment (#4985)Simon Legner
2022-08-23templates: cap of slice should not be smaller than length (#4975)jedy
2022-08-23caddyhttp: Fix for nil `handlerErr.Err` (#4977)Francis Lavoie
2022-08-22caddyhttp: Set `http.error.message` to the HandlerError message (#4971)Francis Lavoie
2022-08-17core: Change net.IP to netip.Addr; use netip.Prefix (#4966)WilczyńskiT
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
2022-08-16caddyhttp: Smarter path matching and rewriting (#4948)Matt Holt
Co-authored-by: RussellLuo <luopeng.he@gmail.com>
2022-08-15fileserver: reset buffer before using it (#4962) (#4963)Abdussamet Koçak
2022-08-15caddyhttp: Enable HTTP/3 by default (#4707)Matt Holt
2022-08-12reverseproxy: Add `unix+h2c` Caddyfile network shortcut (#4953)Francis Lavoie
2022-08-12reverseproxy: Ignore context cancel in stream mode (#4952)Matt Holt
2022-08-12reverseproxy: Fix H2C dialer using new stdlib `DialTLSContext` (#4951)Francis Lavoie
2022-08-09reverseproxy: Support 1xx status codes (HTTP early hints) (#4882)Kévin Dunglas
2022-08-08fileserver: Better fix for Etag of compressed filesMatthew Holt
2022-08-08fileserver: Generate Etag from sidecar fileMatthew Holt
Don't use the primary/uncompressed file for Etag when serving sidecars. This was just overlooked initially.
2022-08-06Replace strings.Index with strings.Cut (#4932)Chirag Maheshwari
2022-08-04Replace strings.Index usages with strings.Cut (#4930)WilczyńskiT
2022-08-04cmd: Use newly-available version information (#4931)Matt Holt
2022-08-03httpserver: Configurable shutdown delay (#4906)Matt Holt
2022-08-02chore: Bump up to Go 1.19, minimum 1.18 (#4925)Francis Lavoie
2022-08-01caddyhttp: Implement `caddy respond` command (#4870)Matt Holt
2022-07-31fileserver: Support virtual file system in CaddyfileMatthew Holt
2022-07-30fileserver: Support virtual file systems (#4909)Matt Holt
* fileserver: Support virtual file systems (close #3720) This change replaces the hard-coded use of os.Open() and os.Stat() with the use of the new (Go 1.16) io/fs APIs, enabling virtual file systems. It introduces a new module namespace, caddy.fs, for such file systems. Also improve documentation for the file server. I realized it was one of the first modules written for Caddy 2, and the docs hadn't really been updated since! * Virtualize FS for file matcher; minor tweaks * Fix tests and rename dirFS -> osFS (Since we do not use a root directory, it is dynamic.)
2022-07-29core: Windows service integration (#4790)WingLim
Co-authored-by: Matthew Holt <mholt@users.noreply.github.com>
2022-07-28Ignore linter warningsMatthew Holt
Use of non-cryptographic random numbers in the load balancing is intentional.