backup
This commit is contained in:
parent
9d94c4d4e2
commit
2255bfc2e2
1 changed files with 3 additions and 3 deletions
|
|
@ -117,15 +117,15 @@ struct http_request *parse_request(struct string *req)
|
||||||
// TODO handle logs and free adequately
|
// TODO handle logs and free adequately
|
||||||
struct http_response *generate_response(struct http_request *req)
|
struct http_response *generate_response(struct http_request *req)
|
||||||
{
|
{
|
||||||
|
// Path
|
||||||
|
|
||||||
// Check filename
|
// Check filename
|
||||||
if (!check_filename(req->path))
|
if (!check_filename(req->path))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
int err = is_directory(req->path->data);
|
int err = is_directory(req->path->data);
|
||||||
if (err == -1)
|
if (err == -1)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
else if (err == 1)
|
||||||
if (err == 1)
|
|
||||||
{
|
{
|
||||||
string_concat_str(req->path, "/", 1);
|
string_concat_str(req->path, "/", 1);
|
||||||
string_concat_str(req->path, config->servers->default_file,
|
string_concat_str(req->path, config->servers->default_file,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue