how to suppress hard-coded response body in 302 redirect
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Hello!
In my Apache module (module AP_MODULE_DECLARE_DATA ... etc etc - low-level Apache module written in C) I need to return a 302 redirect status with no body, Content-Length set to zero, and no content-type (this is a third-party requirement that I cannot change). Apache by default adds hard-coded HTML body and text/html content type.
Basically, I need just to send "Location: xxx" and "Content-Length: 0" headers back (with 302 status). I was able to "block" the hard-coded response body by setting r->header_only to 1, but this seems like a hack, and ap_http_header_filter (called automatically) removes my Content-Length header. And Content-Type is still there (text/plain always added, even if I try to remove it).
I have seen Apache return what I need from a PHP redirect instruction (mod_php), so I know it is possible (or maybe that's a switch/gateway messing with me, I don't know). I just can't seem to find a way to do the same thing using my own module.
Best regards,
Peter
P.S. This is what Apache adds if I don't set r->header_only:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved ...
[Index of Archives]
[Open SSH Users]
[Linux ACPI]
[Linux Kernel]
[Linux Laptop]
[Kernel Newbies]
[Security]
[Netfilter]
[Bugtraq]
[Squid]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Samba]
[Video 4 Linux]
[Device Mapper]