Core mechanics
Two-pass evaluation
- On response headers — response profiling runs with no body buffer.
- On buffered body — hook runs again with detected MIME and size.
Content size
Non-zero min/max tested against body buffer size when present, and against Content-Length when CL flag set. Zero disables each test.MIME and extension
MIME regex tries response Content-Type header, then detected body type. Extension regex tries URL (query stripped), then attachment filename.Schema Fields
Global
- Enabled (
enabled) — off, no labels are added or removed here at all.
Response Types entry
- Enabled (
enabled), Comment (comment) — standard entry controls. - Trace Entry (
profile_tracing) — logs each label this entry adds or removes. - Response Types (
res_types) — gates on a label an earlier entry already applied; supports!negation, blank ignores the gate. - Content type (
mime) — tried against the actual Content-Type header first, then against a body-detected type if that doesn’t match; skipped if neither is available. - File Extension (
file_extension) — tried against the request URL path with the query string removed first, then against the response’s attachment filename from a Content-Disposition header. - Transfer Encoding Chunk (
transfer_encoding_chunk) — YES applies only to a chunked response, NO only to non-chunked, ANY ignores chunking. - Minimum / Maximum Content Size — see Content size above.
- Response header pattern (
responseheader) — a regular expression against raw response headers; skipped if raw headers are unavailable. - Added / Removed Response Types (
add_res_types/remove_res_types) — Removed runs after Added on the same entry.
Examples
Open Configure → Custom Settings → Response Types. Row fields are Enabled, Comment, Trace Entry, Content type (the MIME-pattern field referenced below), Transfer Encoding Chunk, Minimum/Maximum Content Size, and Added Response Types.
Response Types — Response Types rows
How to verify
- Trace Entry; fetch test URL; check native logs.
- Detailed logs —
response_profiles,download_content_types. - To confirm a Response Types DENY blocks as strongly as a request-side DENY, trigger one against a large download and verify the client’s transfer is cut off with the HTTP 451 page, even though SafeSquid may have already retrieved some or all of the body from the origin in a buffered configuration.

