views:

24

answers:

1

The documentation for the ISAPI SetHeader function says that using '\0' for the value of the header will delete the header.

Q1. Is it possible for an ISAPI filter to set the value of a header to the empty string? How?

Q2. Does it even make sense to want to do this? Is it legal in the HTTP protocol to have an empty request header?


Upon reading through RFC 2616, it seems that request headers can be completely empty. In section 14.39, the spec gives an example of the TE header being completely empty.

So, I think the answer to Q2 is "yes", but I'm interested in comments on that. And the answer to Q1 is still unknown.

+1  A: 

Can you use a single space to simulate an empty header, and defeat the '\0' issue?

I wonder if it makes sense - a header is there to impart some info to the server, which an empty header would not. Were there specific headers you were thinking about? Do some headers functions as flags only, with no need for a value?

Ray
I used the single-space idea, and it worked. Thanks.
Cheeso