summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/server.go
AgeCommit message (Collapse)Author
2023-08-14ci: use gci linter (#5708)Jacob Gadikian
* use gofmput to format code * use gci to format imports * reconfigure gci * linter autofixes * rearrange imports a little * export GOOS=windows golangci-lint run ./... --fix
2023-08-09ci: Update to Go 1.21 (#5719)Matt Holt
* ci: Update to Go 1.21 * Bump quic-go to v0.37.4 * Check EnableFullDuplex err * Linter bug suppression See https://github.com/timakin/bodyclose/issues/52 --------- Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2023-08-07templates: Fix httpInclude (fix #5698)Matthew Holt
Allowable during feature freeze because this is a simple, non-invasive bug fix only.
2023-08-02caddyhttp: Make use of `http.ResponseController` (#5654)Francis Lavoie
* caddyhttp: Make use of http.ResponseController Also syncs the reverseproxy implementation with stdlib's which now uses ResponseController as well https://github.com/golang/go/commit/2449bbb5e614954ce9e99c8a481ea2ee73d72d61 * Enable full-duplex for HTTP/1.1 * Appease linter * Add warning for builds with Go 1.20, so it's less surprising to users * Improved godoc for EnableFullDuplex, copied text from stdlib * Only wrap in encode if not already wrapped
2023-06-13caddyhttp: Support custom network for HTTP/3 (#5573)Dominik Roos
Allow registering a custom network mapping for HTTP/3. This is useful if the original network for HTTP/1.1 and HTTP/2 is not a standard `unix`, `tcp4`, or `tcp6` network. To keep backwards compatibility, we fall back to `udp` if the original network is not registered in the mapping. Fixes #5555
2023-05-19caddyhttp: Fix h3 shutdown (#5541)WeidiDeng
* swap h3server close and listener close, avoid quic-listener not closing * fix typo
2023-05-16caddyhttp: Implement named routes, `invoke` directive (#5107)Francis Lavoie
* caddyhttp: Implement named routes, `invoke` directive * gofmt * Add experimental marker * Adjust route compile comments
2023-05-11caddyhttp: Add a getter for Server.name (#5531)jjiang-stripe
2023-04-27logging: Add traceID field to access logs when tracing is active (#5507)Dave Henderson
Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2023-04-10caddyhttp: Serve http2 when listener wrapper doesn't return *tls.Conn (#4929)WeidiDeng
* Serve http2 when listener wrapper doesn't return *tls.Conn * close conn when h2server serveConn returns * merge from upstream * rebase from latest * run New and Closed ConnState hook for h2 conns * go fmt * fix lint * Add comments * reorder import
2023-03-27caddyhttp: Log request body bytes read (#5461)Francis Lavoie
2023-03-27caddyhttp: Determine real client IP if trusted proxies configured (#5104)Francis Lavoie
* caddyhttp: Determine real client IP if trusted proxies configured * Support customizing client IP header * Implement client_ip matcher, deprecate remote_ip's forwarded option
2023-02-06caddyhttp: Pluggable trusted proxy IP range sources (#5328)Francis Lavoie
* caddyhttp: Pluggable trusted proxy IP range sources * Add request to the IPRangeSource interface
2023-02-06chore: Build with Go 1.20, keep minimum at 1.18 for now (#5353)Francis Lavoie
2023-01-10caddyhttp: Add server-level `trusted_proxies` config (#5103)Francis Lavoie
2022-10-13httpcaddyfile: Improve detection of indistinguishable TLS automation ↵Matt Holt
policies (#5120) * httpcaddyfile: Skip some logic if auto_https off * Try removing this check altogether... * Refine test timeouts slightly, sigh * caddyhttp: Assume udp for unrecognized network type Seems like the reasonable thing to do if a plugin registers its own network type. * Add comment to document my lack of knowledge * Clean up and prepare to merge Add comments to try to explain what happened
2022-10-05logging: Fix `skip_hosts` with wildcards (#5102)Francis Lavoie
Fix #4859
2022-09-28core: Refactor and improve listener logic (#5089)Matt Holt
* core: Refactor, improve listener logic Deprecate: - caddy.Listen - caddy.ListenTimeout - caddy.ListenPacket Prefer caddy.NetworkAddress.Listen() instead. Change: - caddy.ListenQUIC (hopefully to remove later) - caddy.ListenerFunc signature (add context and ListenConfig) - Don't emit Alt-Svc header advertising h3 over HTTP/3 - Use quic.ListenEarly instead of quic.ListenEarlyAddr; this gives us more flexibility (e.g. possibility of HTTP/3 over UDS) but also introduces a new issue: https://github.com/lucas-clemente/quic-go/issues/3560#issuecomment-1258959608 - Unlink unix socket before and after use * Appease the linter * Keep ListenAll
2022-09-21Tweak some commentsMatthew Holt
2022-09-16caddyhttp: Support configuring Server from handler provisioning (#4933)WeidiDeng
* configuring http.Server from handlers. * Minor tweaks * Run gofmt Co-authored-by: Matthew Holt <mholt@users.noreply.github.com>
2022-09-16caddyhttp: Make metrics opt-in (#5042)Matt Holt
* caddyhttp: Make metrics opt-in Related to #4644 * Make configurable in Caddyfile
2022-09-15caddyhttp: Add 'skip_log' var to omit request from logs (#4691)Francis Lavoie
* caddyhttp: Implement `skip_log` handler * Refactor to use vars middleware Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
2022-09-08Very minor tweaksMatthew Holt
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-02Minor style adjustments for HTTP redir loggingMatthew Holt
2022-09-01caddyhttp: Copy logger config to HTTP server during AutoHTTPS (#4990)Francis Lavoie
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-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-15caddyhttp: Enable HTTP/3 by default (#4707)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-04-11reverseproxy: Add `_ms` placeholders for proxy durations (#4666)Francis Lavoie
* reverseproxy: Add `_ms` placeholders for proxy durations * Add http.request.duration_ms Also add comments, and change duration_sec to duration_ms * Add response.duration_ms for consistency * Add missing godoc comment Co-authored-by: Matthew Holt <mholt@users.noreply.github.com>
2022-03-11requestbody: Return HTTP 413 (fix #4558)Matthew Holt
2022-03-04caddyhttp: Honor wildcard hosts in log SkipHosts (#4606)Matt Holt
2022-02-19caddyhttp: Always log handled errors at debug level (#4584)Francis Lavoie
2022-01-19caddyhttp: Reject absurd methods (#4538)Matt Holt
* caddyhttp: Reject absurdly long methods * Limit method to 32 chars and truncate * Just reject the request and debug-log it * Log remote address
2022-01-12caddyhttp: Return HTTP 421 for mismatched Host header (#4023)rayjlinden
Potential fix for #4017 although the consensus is unclear. Made change to return status code 421 instead of 403 when StrictSNIHost matching is on.
2021-12-02caddyhttp: Make logging of credential headers opt-in (#4438)Francis Lavoie
2021-11-29logging: Remove common_log field and single_field encoder (#4149) (#4282)Matt Holt
2021-11-22caddyhttp: Log non-500 handler errors at debug level (#4429)Francis Lavoie
Fixes #4428 It's best to still log handler errors at debug level so that they're hidden by default, but still accessible if additional details are necessary.
2021-07-14logging: Prep for `common_log` removal (#4149)Francis Lavoie
See https://github.com/caddyserver/caddy/issues/4148#issuecomment-833207811
2021-07-14caddyhttp: Fix edgecase with auto HTTP->HTTPS logic (#4243)Francis Lavoie
2021-04-19caddyhttp: Implement better logic for inserting the HTTP->HTTPS redirs (#4033)Francis Lavoie
* caddyhttp: Implement better logic for inserting the HTTP->HTTPS redirs * caddyhttp: Add integration test
2021-03-29caddyhttp: improve grammar of comment for AllowH2C (#4072)Simão Gomes Viana
2020-12-02Minor commentsMatthew Holt
2020-11-18caddyhttp: Return error if error handling errorMatthew Holt
Before, if there was an error in the error handler, we would not write a status code, which resulted in Go writing a 200 for us by default, which does not make sense when there's an error. Now we write the second error's status if available, otherwise 500.