」 feat(Requests): now use the config :D

This commit is contained in:
y-syo
2025-05-02 15:04:41 +02:00
parent 2352a865bf
commit bfef8ed76e
7 changed files with 105 additions and 64 deletions

View File

@ -6,7 +6,7 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/04/30 09:50:20 by adjoly #+# #+# */
/* Updated: 2025/04/30 15:18:01 by mmoussou ### ########.fr */
/* Updated: 2025/05/02 15:02:56 by mmoussou ### ########.fr */
/* */
/* ************************************************************************** */
@ -70,7 +70,7 @@ void Post::parse(std::string const &data) {
std::string extractFilename(const std::string &header) {
size_t start = header.find("filename=\"") + 10;
size_t end = header.find("\"", start);
return header.substr(start, end - start);
return this->_route->getUpRoot() + header.substr(start, end - start);
}
void handleMultipartData(const std::string &body, const std::string &boundary) {
@ -104,7 +104,7 @@ void handleMultipartData(const std::string &body, const std::string &boundary) {
Response Post::execute(void) {
http::Response response;
try {
handleMultipartData(
this->_body,