RedirectRedirect handling and cross-origin security utilities
This module provides shared functions for handling HTTP redirects safely, including cross-origin detection and sensitive header stripping.
val src : Logs.srcLogs source for this module
same_origin uri1 uri2 returns true if both URIs have the same origin. Same origin means same host with same scheme, or http->https upgrade. Used to determine if sensitive headers should be preserved during redirects.
strip_sensitive_headers headers removes sensitive headers that should not be sent to cross-origin destinations:
val validate_url : string -> Uri.tvalidate_url location validates that the redirect URL uses an allowed scheme.