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
05c88a98
Commit
05c88a98
authored
Mar 17, 2015
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce -dav_root option
parent
5224afb9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
mongoose.c
mongoose.c
+14
-9
No files found.
mongoose.c
View file @
05c88a98
...
...
@@ -34,8 +34,6 @@
//
// Alternatively, you can license this software under a commercial
// license, as set out in <http://cesanta.com/>.
//
// $Date: 2014-09-28 05:04:41 UTC $
#ifndef NS_SKELETON_HEADER_INCLUDED
#define NS_SKELETON_HEADER_INCLUDED
...
...
@@ -1406,6 +1404,7 @@ enum {
CGI_PATTERN
,
#endif
DAV_AUTH_FILE
,
DAV_ROOT
,
DOCUMENT_ROOT
,
#ifndef MONGOOSE_NO_DIRECTORY_LISTING
ENABLE_DIRECTORY_LISTING
,
...
...
@@ -1444,6 +1443,7 @@ static const char *static_config_options[] = {
"cgi_pattern"
,
DEFAULT_CGI_PATTERN
,
#endif
"dav_auth_file"
,
NULL
,
"dav_root"
,
NULL
,
"document_root"
,
NULL
,
#ifndef MONGOOSE_NO_DIRECTORY_LISTING
"enable_directory_listing"
,
"yes"
,
...
...
@@ -2633,6 +2633,12 @@ void mg_template(struct mg_connection *conn, const char *s,
}
#ifndef MONGOOSE_NO_FILESYSTEM
static
int
is_dav_request
(
const
struct
connection
*
conn
)
{
const
char
*
s
=
conn
->
mg_conn
.
request_method
;
return
!
strcmp
(
s
,
"PUT"
)
||
!
strcmp
(
s
,
"DELETE"
)
||
!
strcmp
(
s
,
"MKCOL"
)
||
!
strcmp
(
s
,
"PROPFIND"
);
}
static
int
must_hide_file
(
struct
connection
*
conn
,
const
char
*
path
)
{
const
char
*
pw_pattern
=
"**"
PASSWORDS_FILE_NAME
"$"
;
const
char
*
pattern
=
conn
->
server
->
config_options
[
HIDE_FILES_PATTERN
];
...
...
@@ -2645,7 +2651,12 @@ static int convert_uri_to_file_name(struct connection *conn, char *buf,
size_t
buf_len
,
file_stat_t
*
st
)
{
struct
vec
a
,
b
;
const
char
*
rewrites
=
conn
->
server
->
config_options
[
URL_REWRITES
];
const
char
*
root
=
conn
->
server
->
config_options
[
DOCUMENT_ROOT
];
const
char
*
root
=
#ifndef MONGOOSE_NO_DAV
is_dav_request
(
conn
)
&&
conn
->
server
->
config_options
[
DAV_ROOT
]
!=
NULL
?
conn
->
server
->
config_options
[
DAV_ROOT
]
:
#endif
conn
->
server
->
config_options
[
DOCUMENT_ROOT
];
#ifndef MONGOOSE_NO_CGI
const
char
*
cgi_pat
=
conn
->
server
->
config_options
[
CGI_PATTERN
];
char
*
p
;
...
...
@@ -4188,12 +4199,6 @@ static int is_authorized_for_dav(struct connection *conn) {
return
authorized
;
}
static
int
is_dav_request
(
const
struct
connection
*
conn
)
{
const
char
*
s
=
conn
->
mg_conn
.
request_method
;
return
!
strcmp
(
s
,
"PUT"
)
||
!
strcmp
(
s
,
"DELETE"
)
||
!
strcmp
(
s
,
"MKCOL"
)
||
!
strcmp
(
s
,
"PROPFIND"
);
}
#endif // MONGOOSE_NO_AUTH
static
int
parse_header
(
const
char
*
str
,
size_t
str_len
,
const
char
*
var_name
,
...
...
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