1
0
mirror of https://github.com/lammertb/libhttp.git synced 2025-08-10 14:23:00 +03:00

Re-activated standalone server

This commit is contained in:
Lammert Bies
2016-12-27 01:21:03 +01:00
parent ce918e9d51
commit 550362dc44
12 changed files with 38 additions and 23 deletions

View File

@@ -67,7 +67,7 @@ void XX_httplib_handle_request( struct httplib_connection *conn ) {
char * var;
} ptr;
if ( conn == NULL ) return;
if ( conn == NULL || conn->ctx == NULL ) return;
ri = & conn->request_info;
is_found = false;
@@ -98,7 +98,7 @@ void XX_httplib_handle_request( struct httplib_connection *conn ) {
ptr.var = strchr( ri->request_uri, '?' );
if ( ptr.var != NULL ) *(ptr.var++) = '\0';
conn->request_info.query_string = ptr.var;
ri->query_string = ptr.var;
/*
* 1.2. do a https redirect, if required. Do not decode URIs yet.
@@ -386,13 +386,13 @@ no_callback_resource:
return;
}
/*
* 9. This request is either for a static file or resource handled
* by a script file. Thus, a DOCUMENT_ROOT must exist.
*/
else if ( conn->ctx->cfg[DOCUMENT_ROOT] == NULL ) {
if ( conn->ctx->cfg[DOCUMENT_ROOT] == NULL ) {
XX_httplib_send_http_error( conn, 404, "%s", "Not Found" );
return;