Fix handling of invalid HTTP requests

Fix check for invalid HTTP request
Actually return the error response we create after parsing an invalid request