1
0
mirror of https://github.com/lammertb/libhttp.git synced 2025-12-22 04:02:04 +03:00

Don't call local request handler for requests with absolute URIs of other servers (#266)

This commit is contained in:
bel
2016-02-26 23:32:35 +01:00
parent bd30fe2fd5
commit 60f207111d

View File

@@ -11796,11 +11796,18 @@ process_new_connection(struct mg_connection *conn)
} }
if (ebuf[0] == '\0') { if (ebuf[0] == '\0') {
handle_request(conn); if (conn->request_info.local_uri) {
if (conn->ctx->callbacks.end_request != NULL) { /* handle request to local server */
conn->ctx->callbacks.end_request(conn, conn->status_code); handle_request(conn);
if (conn->ctx->callbacks.end_request != NULL) {
conn->ctx->callbacks.end_request(conn,
conn->status_code);
}
log_access(conn);
} else {
/* TODO: handle non-local request (PROXY) */
conn->must_close = 1;
} }
log_access(conn);
} else { } else {
conn->must_close = 1; conn->must_close = 1;
} }