Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Revert setters.
  • Loading branch information
bcsgh committed May 14, 2023
commit 32298ca96740ecbd1e48c2a7d782429ee541700c
4 changes: 2 additions & 2 deletions src/http_request.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ struct arguments_accumulator {
std::map<std::string, std::vector<std::string>, http::arg_comparator>* arguments;
};

void http_request::set_method(const std::string& method_) {
method = string_utilities::to_upper_copy(method_);
void http_request::set_method(const std::string& method) {
this->method = string_utilities::to_upper_copy(method);
}

bool http_request::check_digest_auth(const std::string& realm, const std::string& password, int nonce_timeout, bool* reload_nonce) const {
Expand Down
24 changes: 12 additions & 12 deletions src/httpserver/http_request.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,36 +339,36 @@ class http_request {
* Method used to set the content of the request
* @param content The content to set.
**/
void set_content(const std::string& content_) {
content = content_.substr(0, content_size_limit);
void set_content(const std::string& content) {
this->content = content.substr(0, content_size_limit);
}

/**
* Method used to set the maximum size of the content
* @param content_size_limit The limit on the maximum size of the content and arg's.
**/
void set_content_size_limit(size_t content_size_limit_) {
content_size_limit = content_size_limit_;
void set_content_size_limit(size_t content_size_limit) {
this->content_size_limit = content_size_limit;
}

/**
* Method used to append content to the request preserving the previous inserted content
* @param content The content to append.
* @param size The size of the data to append.
**/
void grow_content(const char* content_, size_t size) {
content.append(content_, size);
if (content.size() > content_size_limit) {
content.resize(content_size_limit);
void grow_content(const char* content, size_t size) {
this->content.append(content, size);
if (this->content.size() > content_size_limit) {
this->content.resize(content_size_limit);
}
}

/**
* Method used to set the path requested.
* @param path The path searched by the request.
**/
void set_path(const std::string& path_) {
path = path_;
void set_path(const std::string& path) {
this->path = path;
}

/**
Expand All @@ -381,8 +381,8 @@ class http_request {
* Method used to set the request http version (ie http 1.1)
* @param version The version to set in form of string
**/
void set_version(const std::string& version_) {
version = version_;
void set_version(const std::string& version) {
this->version = version;
}

/**
Expand Down