nyx/tests/fixtures/header_injection/ruby/safe_subscript_set.rb
2026-05-07 01:29:31 -04:00

7 lines
282 B
Ruby

# Safe: tainted request value routed through `strip_crlf` (a registered
# HEADER_INJECTION sanitizer) before the subscript-set, so taint-header-injection
# stays clean.
def handle(params, response)
lang = params["lang"]
response.headers["X-Forwarded-By"] = strip_crlf(lang)
end