Server
Builder for the Server HTTP response header.
Usage
Server()Default header value: ""
Notes
* The default is intentionally empty to avoid leaking server details. * Callers can override this value for compatibility with legacy tooling.
Resources: - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Server - https://owasp.org/www-project-secure-headers/
Parameter Attributes
header_name: str_value: str = HeaderDefaultValue.SERVER.value
Attributes
| Name | Description |
|---|---|
| header_value | Retrieve the current value of the Server header. |
header_value
Retrieve the current value of the Server header.
header_value: str
Returns
str: The current value of the Server header.
Methods
| Name | Description |
|---|---|
| clear() | Reset the Server header value to its default (an empty string). |
| set() | Set a custom value for the Server header. |
| value() | Alias for set() (kept for feature parity with other headers). |
clear()
Reset the Server header value to its default (an empty string).
Usage
clear()This method clears any custom value that has been set for the Server header and reverts it to the default, which hides server details.
Returns
Server: The current instance, allowing for method chaining.
set()
Set a custom value for the Server header.
Usage
set(value)value()
Alias for set() (kept for feature parity with other headers).
Usage
value(value)