Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP Error 400. The request hostname is invalid. #10673

Open
mathewc opened this issue Dec 5, 2024 · 0 comments
Open

HTTP Error 400. The request hostname is invalid. #10673

mathewc opened this issue Dec 5, 2024 · 0 comments

Comments

@mathewc
Copy link
Member

mathewc commented Dec 5, 2024

We've seen that in super rare cases a cold start request to Function App might incorrectly return an error response of the form:

{
  'statusCode': 400,
  'headers': {
    'Date': 'Mon, 25 Nov 2024 19:42:56 GMT',
    'Content-Length': '334',
    'Content-Type': 'text/html'
  },
  'body': '<!DOCTYPE HTML PUBLIC \\'-//W3C//DTD HTML 4.01//EN\\'\\'http://www.w3.org/TR/html4/strict.dtd\\'>\\r\\n<HTML><HEAD><TITLE>Bad Request</TITLE>\\r\\n<META HTTP-EQUIV=\\'Content-Type\\' Content=\\'text/html; charset=us-ascii\\'></ HEAD >\\r\\n<BODY><h2>Bad Request - Invalid Hostname </h2>\\r\\n<hr><p>HTTP Error 400. The request hostname is invalid. </p>\\r\\n</BODY></HTML>'
}

This has come up most recently in the following CRI: https://portal.microsofticm.com/imp/v5/incidents/details/570328048/summary. Investigation has shown that this response isn't coming from the App Service platform, nor the Functions Host runtime. It appears to be coming from ASP.NET HostFilteringMiddleware. Now the Functions Host doesn't register or configure this middleware in any way. See also this code.

While we don't know yet what might be causing this, this issue will serve as a tracking item to see if we get more cases of this. In the case we saw, when the request was retried it succeeded so the issue is super rare and transient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant