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
08746115
Commit
08746115
authored
Aug 18, 2013
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sending EXTRA_HTTP_HEADERS in handle_file_request()
parent
587aad75
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
mongoose.c
mongoose.c
+6
-4
No files found.
mongoose.c
View file @
08746115
...
...
@@ -306,7 +306,7 @@ typedef int socklen_t;
#define MGSQLEN 20
#endif
// Extra HTTP headers to send in every reply
// Extra HTTP headers to send in every
static file
reply
#if !defined(EXTRA_HTTP_HEADERS)
#define EXTRA_HTTP_HEADERS ""
#endif
...
...
@@ -2977,7 +2977,8 @@ static void handle_file_request(struct mg_connection *conn, const char *path,
// actually, range requests don't play well with a pre-gzipped
// file (since the range is specified in the uncmpressed space)
if
(
filep
->
gzipped
)
{
send_http_error
(
conn
,
501
,
"Not Implemented"
,
"range requests in gzipped files are not supported"
);
send_http_error
(
conn
,
501
,
"Not Implemented"
,
"range requests in gzipped files are not supported"
);
return
;
}
conn
->
status_code
=
206
;
...
...
@@ -3005,9 +3006,10 @@ static void handle_file_request(struct mg_connection *conn, const char *path,
"Content-Length: %"
INT64_FMT
"
\r\n
"
"Connection: %s
\r\n
"
"Accept-Ranges: bytes
\r\n
"
"%s%s
\r\n
"
,
"%s%s
%s
\r\n
"
,
conn
->
status_code
,
msg
,
date
,
lm
,
etag
,
(
int
)
mime_vec
.
len
,
mime_vec
.
ptr
,
cl
,
suggest_connection_header
(
conn
),
range
,
encoding
);
mime_vec
.
ptr
,
cl
,
suggest_connection_header
(
conn
),
range
,
encoding
,
EXTRA_HTTP_HEADERS
);
if
(
strcmp
(
conn
->
request_info
.
request_method
,
"HEAD"
)
!=
0
)
{
send_file_data
(
conn
,
filep
,
r1
,
cl
);
...
...
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