Vadym_Chepkov
Mar 05, 2021Nimbostratus
How to preserve HTTP headers for HTTP::respond
I need to preserve HTTP headers for HTTP::respond, I tried the following approach
when HTTP_RESPONSE {
if {[HTTP::has_responded]} {return}
catch { unset hdrs }
foreach header [HTTP::header names] {
lappend hdrs $header "[HTTP::header $header]"
}
log local0. "Headers: $hdrs"
HTTP::respond 301 -version auto $hdrs
}
Headers appear properly in the log, but I don't receive them in the response, only Connection Content-Length and Server are populated
Don't see errors either. What did I miss?
Thanks,
Vadym