This commit is contained in:
Mateusz Gruszczyński committed 2026-10-07 08:51:04 +02:00
1 parent a9f9450f80
commit 762eb9e28b
81 files changed
+1242 -1095

No files matched your search

+29 -21
View File
@@ -31,7 +31,7 @@ this and preserves dirty settings forms across status/language refreshes.
"http2_settings":{"idle_timeout_seconds":300, "max_connection_lifetime_seconds":0, "drain_timeout_seconds":10}}}
]
},
"server_header": {"mode":"custom", "value":"RustProxy/v0.20.0"},
"server_header": {"mode":"custom", "value":"RustProxy"},
"compression": {"gzip":true, "br":true, "zstd":true, "deflate":false, "min_bytes":1024},
"headers": {
"request": [{"op":"set", "name":"x-proxy-name", "value":"RustProxy"}],
@@ -206,7 +206,7 @@ endpoints are rejected rather than silently widened.
## Server and other client headers
`server_header.mode` is `preserve` (default), `hide`, or `custom`. Custom values are
`server_header.mode` is `preserve`, `hide`, or `custom`. Fresh installations default to `custom` with the exact value `RustProxy`; existing saved installations retain their configured policy. Custom values are
nonempty, bounded to 256 bytes and validated against header injection. Preserve
means retain the result of origin/global/route rules; it does not add a missing
header. Hide/custom take final precedence, including proxy-generated errors.
@@ -225,26 +225,34 @@ snapshot; no mixed-version configuration is applied midway through a response.
## Compression
All four flags default false. `min_bytes` defaults to 1024 (valid 32..1048576).
The library's default small-body/content-type predicate is also retained; actual
minimum for a known-size body is at least that default. Unknown-length text bodies
can be streamed without pre-buffering merely to discover their size.
`zstd`, Brotli and gzip default ON; deflate defaults OFF. `min_bytes` defaults to 1024
(valid 32..1048576). The streaming middleware keeps its default content-type safety
predicate plus the RustProxy minimum-size predicate. Unknown-length eligible bodies can
be streamed without aggregating the complete response merely to discover its size.
Accept-Encoding quality negotiation is delegated to tower-http. Text, JSON,
JavaScript, XML, SVG and wasm are eligible; already encoded, SSE, range, upgrade,
HEAD/204/304 and privacy-sensitive responses are excluded. Authorization and arbitrary
cookie-bearing dynamic responses remain excluded. A cookie-bearing request may be
compressed only when RustProxy is already serving a shared-cache HIT accepted by cache
policy (including the configured static-cookie exception) or a local static Web Server
response. Origin `private`, `no-store`, `no-transform` and `Set-Cookie` exclusions still
win. Cached identity bodies can be streamed through compression on HIT; origin encodings
are passed through without recompression.
RustProxy parses `Accept-Encoding` quality weights before invoking the encoder. Client
`q` values win. When two or more enabled codecs have equal quality, the deterministic
server preference is `zstd -> br -> gzip -> deflate`. An existing `Content-Encoding` is
always passed through and never recompressed. `no-transform`, request ranges/Content-Range,
SSE, upgrades, HEAD/1xx/204/304 and explicitly skipped internal responses remain excluded.
`Cookie`, `Authorization`, `Set-Cookie`, `Cache-Control: private` and `no-store` do not by
themselves disable compression; cacheability and dynamic compression are separate policies.
Applications that place secrets and attacker-controlled reflection in the same compressed
response can disable compression at the vhost or Web Service scope when their threat model
requires BREACH-style mitigation.
Vary: Accept-Encoding is added by compression; content length is removed for the
transformed body. Strong ETags are weakened, and identity-body content digests and
Accept-Ranges are removed. Encoders use their fastest preset; there is no panel
compression-quality slider in this release. Real binary interoperability tests
are still an acceptance requirement, not a result of this packaging session.
The global Response panel selects available codecs and the minimum size. Each ordinary
vhost may inherit, enable or disable dynamic compression and independently inherit/enable/disable
zstd, Brotli, gzip and deflate. Generated Docker vhosts and Web Server services expose the same
per-scope codec filters. When a scope is explicitly Disabled, the dashboard hides and disables
those codec controls without clearing their saved values. Global codec switches remain the hard
ceiling: a local `true` override cannot enable a codec disabled in the global Response panel.
`min_bytes` remains global.
`Vary: Accept-Encoding` is added when compression is negotiated; content length is removed
for the transformed body. Strong ETags are weakened, and identity-body content digests and
`Accept-Ranges` are removed. Encoders use their fastest preset; there is no panel
compression-quality slider in this release.
## Diagnostics and units
@@ -288,7 +296,7 @@ to downgrade.
Vhosts have their own backend pool, health/keepalive/affinity controls, ACL and
security/custom response headers. See VHOSTS.md. Global Server policy still takes
final precedence. There is no per-vhost compression algorithm override.
final precedence. Per-vhost compression can filter individual globally enabled codecs.
The reported `SizeAbove(u16)` compilation error is removed by a custom u64 predicate,
not a cast or panic-producing conversion. Compression thresholds retain the full