Skip to content

Commit

Permalink
build(fix): fix build error cause not allowed .back method
Browse files Browse the repository at this point in the history
  • Loading branch information
552020 committed May 17, 2024
1 parent 60cd38d commit bcf9b24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/HTTPRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void HTTPRequest::setMethod(std::string method)

void HTTPRequest::setRequestTarget(std::string requestTarget)
{
if (!requestTarget.empty() && requestTarget != "/" && requestTarget.back() == '/')
if (!requestTarget.empty() && requestTarget != "/" && requestTarget[requestTarget.size() - 1] == '/')
requestTarget = requestTarget.substr(0, requestTarget.size() - 1);
_requestTarget = requestTarget;
}
Expand Down

0 comments on commit bcf9b24

Please sign in to comment.