Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
2207e87c
Commit
2207e87c
authored
Dec 11, 2015
by
Sergey Lyubka
Committed by
rojer
Dec 11, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix DAV for non-existent files. Improve logging
PUBLISHED_FROM=39a2810ad9bebcf1676b982f7523aa9c2339cc4f
parent
5bd59c7b
Changes
1
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 @
2207e87c
...
...
@@ -6248,6 +6248,10 @@ static void send_options(struct mg_connection *nc) {
nc
->
flags
|=
MG_F_SEND_AND_CLOSE
;
}
static
int
is_creation_request
(
const
struct
http_message
*
hm
)
{
return
mg_vcmp
(
&
hm
->
method
,
"MKCOL"
)
==
0
||
mg_vcmp
(
&
hm
->
method
,
"PUT"
)
==
0
;
}
void
mg_send_http_file
(
struct
mg_connection
*
nc
,
char
*
path
,
size_t
path_buf_len
,
struct
http_message
*
hm
,
struct
mg_serve_http_opts
*
opts
)
{
...
...
@@ -6269,7 +6273,8 @@ void mg_send_http_file(struct mg_connection *nc, char *path,
!
is_authorized
(
hm
,
path
,
is_directory
,
opts
->
auth_domain
,
opts
->
per_directory_auth_file
,
0
))
{
mg_send_digest_auth_request
(
nc
,
opts
->
auth_domain
);
}
else
if
((
stat_result
!=
0
||
is_file_hidden
(
path
,
opts
))
&&
!
is_dav
)
{
}
else
if
((
stat_result
!=
0
||
is_file_hidden
(
path
,
opts
))
&&
!
is_creation_request
(
hm
))
{
mg_printf
(
nc
,
"%s"
,
"HTTP/1.1 404 Not Found
\r\n
Content-Length: 0
\r\n\r\n
"
);
}
else
if
(
is_directory
&&
path
[
strlen
(
path
)
-
1
]
!=
'/'
&&
!
is_dav
)
{
mg_printf
(
nc
,
...
...
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