Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scheme #2721

Open
wants to merge 2 commits into
base: v3/master
Choose a base branch
from
Open

Scheme #2721

Changes from all commits
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
6 changes: 3 additions & 3 deletions src/transaction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -522,14 +522,14 @@ int Transaction::processURI(const char *uri, const char *method,
if (!m_uri_decoded.empty() && m_uri_decoded.at(0) != '/') {
bool fullDomain = true;
size_t scheme = m_uri_decoded.find(":")+1;
if (scheme == std::string::npos) {
if (scheme == std::string::npos) { //impossible case, for +1 in size_t scheme = m_uri_decoded.find(":")+1
fullDomain = false;
}
// Searching with a pos of -1 is undefined we also shortcut
if (scheme != std::string::npos && fullDomain == true) {
// Assuming we found a colon make sure its followed
size_t netloc = m_uri_decoded.find("//", scheme) + 2;
if (netloc == std::string::npos || (netloc != scheme + 2)) {
size_t netloc = m_uri_decoded.find("//", scheme) + 2;//
if (netloc == std::string::npos || (netloc != scheme + 2)) { //(netloc == std::string::npos) will be false forever, for +2 in size_t netloc = m_uri_decoded.find("//", scheme) + 2
fullDomain = false;
}
if (netloc != std::string::npos && fullDomain == true) {
Expand Down