Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
mongoose
Commits
dcd4e660
Commit
dcd4e660
authored
Oct 21, 2015
by
Sergey Lyubka
Committed by
Marko Mikulicic
Oct 21, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Serve current dir by default in mg_serve_http()
PUBLISHED_FROM=421b4256629b2bccd20ceb127ece02be57085b40
parent
96409e74
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
mongoose.c
mongoose.c
+6
-1
No files found.
mongoose.c
View file @
dcd4e660
...
...
@@ -5772,7 +5772,10 @@ void mg_serve_http(struct mg_connection *nc, struct http_message *hm,
struct
mg_serve_http_opts
opts
)
{
char
path
[
MG_MAX_PATH
];
struct
mg_str
*
hdr
;
uri_to_path
(
hm
,
path
,
sizeof
(
path
),
&
opts
);
if
(
opts
.
document_root
==
NULL
)
{
opts
.
document_root
=
"."
;
}
if
(
opts
.
per_directory_auth_file
==
NULL
)
{
opts
.
per_directory_auth_file
=
".htpasswd"
;
}
...
...
@@ -5788,6 +5791,8 @@ void mg_serve_http(struct mg_connection *nc, struct http_message *hm,
if
(
opts
.
index_files
==
NULL
)
{
opts
.
index_files
=
"index.html,index.htm,index.shtml,index.cgi,index.php"
;
}
uri_to_path
(
hm
,
path
,
sizeof
(
path
),
&
opts
);
mg_send_http_file
(
nc
,
path
,
sizeof
(
path
),
hm
,
&
opts
);
/* Close connection for non-keep-alive requests */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment