HTTP 505 HTTP Version Not Supported indicates the server does not support the HTTP protocol version used in the request. In practice, this is extremely rare since modern servers support HTTP/1.0, HTTP/1.1, and HTTP/2. You might encounter it when: connecting to a legacy server that only supports HTTP/1.0, sending HTTP/2 to a server that only accepts HTTP/1.1, or when malformed requests are interpreted as an unknown HTTP version.
Response includes the status code, standard headers (including Content-Type), and a small diagnostic JSON body describing the request and returned status.
Simulator URL (copy in the app after load — not a normal link):
https://httpstatus.com/api/status/505
Example request:
curl -i "https://httpstatus.com/api/status/505"The server does not support the HTTP protocol version used in the request.
On this code, Inspector focuses on semantics, headers, and correctness warnings that commonly affect clients and caches.
HTTP 505 HTTP Version Not Supported represents a specific server-side condition that requires different handling than other 5xx errors. Understanding the precise cause helps operations teams diagnose and resolve issues faster. Monitoring systems should distinguish 505 from other 5xx codes for accurate alerting and diagnosis.
// Handle 505 HTTP Version Not Supported
process.on('unhandledRejection', (reason) => {
console.error('Unhandled rejection:', reason);
});
app.use((err, req, res, next) => {
console.error(`${req.method} ${req.url}:`, err.stack);
res.status(err.status || 500).json({
error: process.env.NODE_ENV === 'production'
? 'Internal Server Error'
: err.message,
requestId: req.id
});
});from fastapi import FastAPI, Request
from fastapi.responses import JSONResponse
import logging
logger = logging.getLogger(__name__)
@app.exception_handler(Exception)
async def server_error_handler(request: Request, exc: Exception):
logger.error(f'{request.method} {request.url}: {exc}',
exc_info=True)
return JSONResponse(
status_code=505,
content={'error': 'HTTP Version Not Supported', 'request_id': request.state.id}
)@ControllerAdvice
public class GlobalErrorHandler {
private static final Logger log = LoggerFactory.getLogger(
GlobalErrorHandler.class);
@ExceptionHandler(Exception.class)
public ResponseEntity<ErrorResponse> handleException(
Exception ex, HttpServletRequest req) {
log.error("{} {}: {}", req.getMethod(),
req.getRequestURI(), ex.getMessage(), ex);
return ResponseEntity.status(505)
.body(new ErrorResponse("HTTP Version Not Supported",
"An unexpected error occurred"));
}
}func errorMiddleware(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
defer func() {
if err := recover(); err != nil {
log.Printf("%s %s: %v\n%s",
r.Method, r.URL, err, debug.Stack())
w.WriteHeader(505)
json.NewEncoder(w).Encode(map[string]string{
"error": "HTTP Version Not Supported",
})
}
}()
next.ServeHTTP(w, r)
})
}