mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-23 20:36:53 +01:00
Small improvements to the simple web server.
This commit is contained in:
parent
0cfc5ed610
commit
76141ee7e7
@ -550,20 +550,23 @@ int HTTPParser::on_multipart_part_data_end_cb() {
|
||||
#endif
|
||||
|
||||
if (_multipart_form_is_file) {
|
||||
PoolByteArray file_data;
|
||||
int len = _multipart_form_data.size();
|
||||
file_data.resize(len);
|
||||
PoolByteArray::Write w = file_data.write();
|
||||
const char *r = _multipart_form_data.ptr();
|
||||
for (int i = 0; i < len; i++) {
|
||||
w[i] = r[i];
|
||||
if (_multipart_form_data.size() > 0) {
|
||||
PoolByteArray file_data;
|
||||
int len = _multipart_form_data.size();
|
||||
file_data.resize(len);
|
||||
PoolByteArray::Write w = file_data.write();
|
||||
const char *r = _multipart_form_data.ptr();
|
||||
for (int i = 0; i < len; i++) {
|
||||
w[i] = r[i];
|
||||
}
|
||||
|
||||
w.release();
|
||||
|
||||
_request->add_file(_multipart_form_name, _multipart_form_filename, file_data);
|
||||
}
|
||||
|
||||
w.release();
|
||||
|
||||
_request->add_file(_multipart_form_name, _multipart_form_filename, file_data);
|
||||
} else {
|
||||
_request->add_parameter(_multipart_form_name, String(_multipart_form_data.ptr()));
|
||||
String s = _multipart_form_data.ptr();
|
||||
_request->add_parameter(_multipart_form_name, s);
|
||||
}
|
||||
|
||||
_multipart_form_is_file = false;
|
||||
|
@ -1,16 +1,16 @@
|
||||
#include "simple_web_server_request.h"
|
||||
|
||||
#include "core/object/object.h"
|
||||
#include "modules/web/http/web_server.h"
|
||||
#include "modules/web/http/web_server_cookie.h"
|
||||
#include "core/object/object.h"
|
||||
|
||||
#include "modules/web/http/http_session.h"
|
||||
|
||||
#include "modules/web/http/http_session_manager.h"
|
||||
#include "modules/web/http/web_node.h"
|
||||
|
||||
#include "modules/web/http/web_permission.h"
|
||||
#include "http_server_simple.h"
|
||||
#include "modules/web/http/web_permission.h"
|
||||
|
||||
String SimpleWebServerRequest::get_cookie(const String &key) {
|
||||
for (int i = 0; i < _cookies.size(); ++i) {
|
||||
|
Loading…
Reference in New Issue
Block a user