简体   繁体   中英

How to prevent Content-Type header from being added by web servers

I have a PHP script setting the Content-Type header to an empty value:

header('Content-Type: ');

This prevents nginx and Apache2 from setting the header, but the PHP development server sends the header even though it is empty.

I would like to know the best way to prevent this header from being added by web servers when the body of the response message is empty.

Thank you!

Maybe header_remove ?

header_remove('Content-Type');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM