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
7865ed7b
Commit
7865ed7b
authored
Sep 19, 2010
by
valenok
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SCRIPT_FILENAME should be relative to document root, and begin with slash.
parent
fb87fd53
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
mongoose.c
mongoose.c
+8
-10
No files found.
mongoose.c
View file @
7865ed7b
...
...
@@ -1528,7 +1528,7 @@ static void convert_uri_to_file_name(struct mg_connection *conn,
change_slashes_to_backslashes
(
buf
);
#endif
/* _WIN32 */
DEBUG_TRACE
((
"[%s] -> [%s]
"
,
uri
,
buf
));
DEBUG_TRACE
((
"[%s] -> [%s]
, [%.*s]"
,
uri
,
buf
,
(
int
)
vec
.
len
,
vec
.
ptr
));
}
static
int
sslize
(
struct
mg_connection
*
conn
,
int
(
*
func
)(
SSL
*
))
{
...
...
@@ -2743,7 +2743,7 @@ static char *addenv(struct cgi_env_block *block, const char *fmt, ...) {
static
void
prepare_cgi_environment
(
struct
mg_connection
*
conn
,
const
char
*
prog
,
struct
cgi_env_block
*
blk
)
{
const
char
*
s
,
*
s
cript_filename
,
*
s
lash
;
const
char
*
s
,
*
slash
;
struct
vec
var_vec
,
root
;
char
*
p
;
int
i
;
...
...
@@ -2751,11 +2751,6 @@ static void prepare_cgi_environment(struct mg_connection *conn,
blk
->
len
=
blk
->
nvars
=
0
;
blk
->
conn
=
conn
;
// SCRIPT_FILENAME
script_filename
=
prog
;
if
((
s
=
strrchr
(
prog
,
'/'
))
!=
NULL
)
script_filename
=
s
+
1
;
get_document_root
(
conn
,
&
root
);
addenv
(
blk
,
"SERVER_NAME=%s"
,
conn
->
ctx
->
config
[
AUTHENTICATION_DOMAIN
]);
...
...
@@ -2773,10 +2768,13 @@ static void prepare_cgi_environment(struct mg_connection *conn,
addenv
(
blk
,
"REMOTE_PORT=%d"
,
conn
->
request_info
.
remote_port
);
addenv
(
blk
,
"REQUEST_URI=%s"
,
conn
->
request_info
.
uri
);
// SCRIPT_NAME
assert
(
conn
->
request_info
.
uri
[
0
]
==
'/'
);
slash
=
strrchr
(
conn
->
request_info
.
uri
,
'/'
);
addenv
(
blk
,
"SCRIPT_NAME=%.*s%s"
,
(
slash
-
conn
->
request_info
.
uri
)
+
1
,
conn
->
request_info
.
uri
,
script_filename
);
if
((
s
=
strrchr
(
prog
,
'/'
))
==
NULL
)
s
=
prog
;
addenv
(
blk
,
"SCRIPT_NAME=%.*s%s"
,
slash
-
conn
->
request_info
.
uri
,
conn
->
request_info
.
uri
,
s
);
addenv
(
blk
,
"SCRIPT_FILENAME=%s"
,
prog
);
addenv
(
blk
,
"PATH_TRANSLATED=%s"
,
prog
);
...
...
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