You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
can not get or change default response header Server #6
and if I change header Server to other strings,
I cound get this string,
but I could see from Chrome devtools that it's value is MakoServer.net and this string.
there're two values for header Server now. why?
<?lsp
response:setheader('Server', 'myServer')
response:write('Server: ',response:containsheader('Server')) -- got myServer, but MakoServer.net still exists
?>
is this a bug , or it is a feature ?
doc says that the new value overwrites the previous one :
response:setheader(name [, value])
Sets a HTTP response header with the given name and value. If the header had already been set, the new value overwrites the previous one. The response:containsheader method can be used to test for the presence of a header before setting its value. If the value is not provided then the named header is removed from the response.
setheader() should be called before the response has been committed to the client, (before response body output has been flushed). If the response already has been committed, this method returns false.
Activity
surfskidude commentedon Oct 4, 2022
This is a feature. Some headers are reserved. The following works:
response:setheader('Hello', 'World')
trace(response:containsheader'Hello')