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
I am working on .NET8 Azure Function in C# and I want to hide the Kestrel Server information from response headers.
We have migrated our application from (.NET6 in-process model to .NET8 isolated) and I have made a few changes in code to remove this server property from the response header.
I have added extensions property in host.json like this - -->
"extensions": {
"http": {
"customHeaders": {
"Server": ""
}
}
}
and also I have added a configuration in Program.cs like this .---> ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseKestrel(option => option.AddServerHeader = false);
})
It is working locally but when I am deploying it our function app is getting 500 Internal Server Error.
Also If we create a fresh new endpoint on .NET 8 isolated, then by default we don’t get any Server property in the response header.
The text was updated successfully, but these errors were encountered:
I am working on .NET8 Azure Function in C# and I want to hide the Kestrel Server information from response headers.
We have migrated our application from (.NET6 in-process model to .NET8 isolated) and I have made a few changes in code to remove this server property from the response header.
I have added extensions property in host.json like this - -->
"extensions": {
"http": {
"customHeaders": {
"Server": ""
}
}
}
and also I have added a configuration in Program.cs like this .---> ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseKestrel(option => option.AddServerHeader = false);
})
It is working locally but when I am deploying it our function app is getting 500 Internal Server Error.
Also If we create a fresh new endpoint on .NET 8 isolated, then by default we don’t get any Server property in the response header.
The text was updated successfully, but these errors were encountered: