- [ffi] Add
redirectionio_trusted_proxies_contains(), which tells whether an address is one of the trusted proxies - [http] Add
fingerprintstoRequestandLog: thetls(JA4),tcp(p0f signature) andhttp2(Akamai format) fingerprints of the client connection, set withRequest::set_fingerprint(),redirectionio_request_set_fingerprint()or the wasmRequest.set_fingerprint()by the integration which can read them - an unknown name, an empty value, or one longer than 256 bytes or not printable ASCII is ignored - [api] Add
client_iptoLog: the request remote address, as resolved from the trusted proxies byredirectionio_request_set_forwarded()orRequest::set_remote_ip() - [api] Add a selection of the request headers to
Log(Accept,Accept-Language,Accept-Encoding,From,Sec-Fetch-*,Sec-CH-UA*), lowercased and cut at 256 bytes, along withSignature,Signature-InputandSignature-Agent(RFC 9421), kept whole up to 1024 bytes and left out beyond - no other header is logged; the list is always sent byLog::from_proxy(), even empty - [action] Add the
captcharule action: without a valid cookie (rio_captchaunlesscookie_namesays otherwise, any name that is not a plain token falling back to it), the request is answered with a 403 HTML page running a proof of work and browser automation checks, which then stores its result in the cookie; the cookie is checked statelessly (HMAC keyed by the newRouterConfig::captcha_secret, so that a browser that solved a challenge goes through every captcha rule of the router, and bound to the client network and user agent, expiry, proof of work; no secret, no challenge), the rule stops the processing while the challenge is served, and the outcome is logged as acaptcha:challenged,captcha:rejectedorcaptcha:passedtag - ignored on a rule with a response status codes trigger, and on an unknown provider
- [http] Drop a default port (80 or 443) from the request host, whatever the scheme, in every
Requestconstructor,set_host()andrebuild_with_config(): a rule onexample.comnow matches a client sendingHost: example.com:443, any other port is kept - [http] Add
Request::set_scheme()andRequest::set_host() - [ffi] Add
redirectionio_request_set_forwarded(), which also takes the scheme and the host from a trusted proxy'sForwardedheader -redirectionio_request_set_remote_addr()still only sets the remote ip - [action] Add the
log_tagsrule action: tags from every applied rule are merged, deduplicated and sorted byAction::get_log_tags(), honouring the rule's response status codes trigger - [api] Add
tagstoLog, set withLog::with_tags()- the FFI and wasmcreate_log_in_jsonfill it from the action - [router] Add the
response_headervariable, resolved from the backend response headers before the header filters apply: usable in header filters, body filters and log tags, so a rule can tag the logs with a response header then remove it - [action] Add the
request_header_filtersrule action, which adds, replaces or removes headers of the request forwarded to the backend withAction::filter_request_headers(); framing and hop-by-hop headers (Host,Content-Length,Connection…) are never changed, and the action is ignored on a rule with a response status codes trigger - aresponse_headervariable falls back to its default there - [ffi] Add
redirectionio_action_request_header_filter_filter(), which returns null when the request has to be left untouched; non UTF-8 request headers are forwarded untouched - [api] Add
backend_request_headersto the explain request and test examples output - [api] Report a backend switch as applied when replaying a test example
- [chore] Update dependencies (lol_html 3, html-to-markdown-rs 3.11…)
- [filter] Do not append or prepend text to media and other binary content types, which splicing corrupts - replacing a body still applies to every content type
- [action] Expose the agent protocol version carried in match responses:
PROTOCOL_VERSION_MAJOR/PROTOCOL_VERSION_MINOR,Action::set_agent_protocol_version()andAction::agent_supports_rule_count(), so a proxy can tell whether the agent understands theRULE_COUNTcommand (protocol >= 1.1) before sending it - [ffi] Add
redirectionio_action_agent_supports_rule_count() - [router] Fix options for variables with output transforms
- [router] Fix rule matching for sampling, and ignore sampling in examples
- [action] Fix capture backend response headers to pass them to body filters before redirection.io mutates them
- [chore] Avoid string memory allocation in some cases to improve performance
- [ffi] Add new ffi endpoint to free memory from rust side, since memory allocator may be different
- [exemple] Allow to pass headers / body when testing example
- [action] Add new action to transform html into markdown
- [action] Add new html filters, to allow remove, or adding html after / before an element
- [ffi] remove log callback (keep the method for BC purpose, but it does not do anything), only allow to enable trace on stderr
- [log] replace log with tracing
- [chore] Migrate to rust 2024 edition
- [action] Replace custom html parser with lol_html
- [action] Add support for capturing values in html
- [router] Fix header case sensitivity in header filters and actions
- [router] Make header and host matching case insensitive by default
- [log] Add support to pass match and proxy duration in log
- [router] Fix not one of ip triggers
- [router] Add cache support for regex in headers
- [action] Add support for overriding proxy destination (only in next agent version)
- [wasm] Add a method to serialize the action matched for a response
- [router] Add a config option to ignore all query parameters
- [router] Add a config option respect the order of query parameters (matching a=a&b=b against match b=b&a=a will not match if the option is true)
- [wasm] Add a method to check if an action will need to manipulate the response.
- Add wasmbindgen feature to not expose the library as a javascript module when used as a dependency by default
- Fix request time in proxy log to work with millisecond precision
- Export this library as a javascript module with webassembly
- Fix wasm integration by removing call to
SystemTime::nowwhich is not available in wasm - Fix default local network for trusted proxies
- Add default header action
- Fix building without specific features
- Updated dependencies
- Fix request time in log
- Add backend duration to log
- Updated dependencies
- Improve memory usage in router
- Improve performance when creating a router
- Improve performance when using html filters
- Fix parsing bug in ip address for logs and request matching
- Fix incorrect behavior when matching a request against a response status code
- Add support for excluding methods in request matching
- Add support for excluding response status code in request matching
- Add optional features to libredirectionio, to allow better compilation on wasm target
- Add new trigger support for date, time and date time
- Add support for deflate and brotli compression
- Avoid creating a body filter if there is only compression and no real filters
- Fix supporting host with port
- Add support to trusted proxies in log to avoid collecting their ips
- Support streaming body when there is compression
- Fix a bug in wasm target compilation that make it impossible to compile
- Ensure order for rules, no rules will always be applied in the same order even if they have the same priority, as they are sorted by their ID
- Body filters will now only be applied on a correct content-type header
- Add support for gzip compression in body filter
- Hardened error handling in body filter
- Update crate to publish on crates.io
- Add support to trigger on specific ip address
- Add variable feature which allow using request properties in action values
- Add append/prepend/replace text content
- Fix cases when an url could not be parsed
- Fix wrong rule ids reported in log or header
- Add cache support for cloudflare worker
- Dependencies update
- Allow to globally ignore and copy specific query parameter
- Add client ip to log
- Extract ip from forwraded header in log
- Initial stable version of libredirectionio