Re: [PATCH] Allow unsetting headers previously set using header()

From: Date: Mon, 20 Oct 2008 07:12:07 +0000
Subject: Re: [PATCH] Allow unsetting headers previously set using header()
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-41283@lists.php.net to get a copy of this message
On Sun, Oct 19, 2008 at 23:41, Christian Schmidt <chsc@peytz.dk> wrote: > When a header has been set using header('Foo: bar') it can be replaced with > another value, but it cannot be removed. Hah! Hit that one last Friday too, gosh that was annoying! > I suggest extending the behaviour of header() so that when the first > argument does not contain a colon (and does not begin with "HTTP/"), e.g. > header('Vary'), it unsets the header with the specified name. I decided to > extend the existing header() function rather than adding a new function, > because the existing function already supports multiple actions (add, append > and replace). That isn't very intuitive. I would think it was a typo when reading such code and fix the header line... I'd suggest explicit header_remove("Vary"); -Hannes

« previous php.internals (#41283) next »