mirror of
https://github.com/caddyserver/caddy.git
synced 2026-06-23 01:20:32 +00:00
This is a shared encode_test harness with HTML/JSON/JS/CSS payloads taken from caddyserver.com Benchmarks: - BenchmarkStandardEncodingPayloads: raw encoder NewEncoder/Write/Close path - BenchmarkEncodeHandlerCorpus: full Encode.ServeHTTP middleware path - Grid: 4 payloads × gzip levels 1/5/9 × zstd fastest/default/best - Each subtest runs with 4 parallel workers; compare runs on MB/s and allocs/op Conformance tests: - Encoder contract: Reset, Flush, Close, and pool-style Reset-after-Close reuse - Corpus HTTP encoding: Content-Encoding, Vary, ETag suffix, header stripping - Response semantics: minimum_length, 304, HEAD, range, WebSocket bypass, If-None-Match rewrite, Cache-Control no-transform, content-type matcher rejection
8 lines
200 B
Go
8 lines
200 B
Go
package encode
|
|
|
|
import "net/http"
|
|
|
|
// HasVaryValue exposes hasVaryValue for external tests in encode_test.
|
|
func HasVaryValue(hdr http.Header, target string) bool {
|
|
return hasVaryValue(hdr, target)
|
|
}
|