mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-23 01:29:33 +00:00
Parse filename for POST requests
so we can return it in the "Location:" header subsequently
This commit is contained in:
parent
54c1cd05e8
commit
7637164ae7
@ -1124,6 +1124,15 @@ PT_THREAD(handle_input(struct httpd_state *s))
|
||||
}
|
||||
} else if(strncasecmp(s->inputbuf, http_post, 5) == 0) {
|
||||
s->request_type = REQUEST_TYPE_POST;
|
||||
PSOCK_READTO(&s->sin, ISO_space);
|
||||
|
||||
if(s->inputbuf[0] != ISO_slash) {
|
||||
PSOCK_CLOSE_EXIT(&s->sin);
|
||||
}
|
||||
|
||||
s->inputbuf[PSOCK_DATALEN(&s->sin) - 1] = 0;
|
||||
strncpy(s->filename, s->inputbuf, sizeof(s->filename));
|
||||
|
||||
/* POST: Read out the rest of the line and ignore it */
|
||||
PSOCK_READTO(&s->sin, ISO_nl);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user