mirror of
https://github.com/J-D-K/JKSV.git
synced 2026-03-21 17:24:37 -05:00
URL and Form fixes.
This commit is contained in:
parent
073d8a5169
commit
a24331b72a
|
|
@ -10,7 +10,7 @@ remote::Form &remote::Form::append_parameter(std::string_view param, std::string
|
|||
const size_t endLength = m_offset + paramLength + valueLength + 1;
|
||||
if (endLength >= SIZE_FORM_BUFFER) { return *this; }
|
||||
|
||||
if (m_offset > 0 && m_formBuffer[m_offset] != '&') { m_formBuffer[m_offset++] = '&'; }
|
||||
if (m_offset > 0 && m_formBuffer[m_offset - 1] != '&') { m_formBuffer[m_offset++] = '&'; }
|
||||
|
||||
std::copy(param.begin(), param.end(), &m_formBuffer[m_offset]);
|
||||
m_offset += paramLength;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ remote::URL &remote::URL::append_path(std::string_view path) noexcept
|
|||
const size_t pathLength = path.length();
|
||||
if (m_offset + pathLength >= SIZE_URL_BUFFER) { return *this; }
|
||||
|
||||
if (m_urlBuffer[m_offset] != '/' && path.front() != '/') { m_urlBuffer[m_offset++] = '/'; }
|
||||
if (m_urlBuffer[m_offset - 1] != '/' && path.front() != '/') { m_urlBuffer[m_offset++] = '/'; }
|
||||
|
||||
std::copy(path.begin(), path.end(), &m_urlBuffer[m_offset]);
|
||||
m_offset += pathLength;
|
||||
|
|
@ -51,7 +51,7 @@ remote::URL &remote::URL::append_parameter(std::string_view param, std::string_v
|
|||
remote::URL &remote::URL::append_slash() noexcept
|
||||
{
|
||||
if (m_offset >= SIZE_URL_BUFFER) { return *this; }
|
||||
else if (m_urlBuffer[m_offset] != '/') { m_urlBuffer[m_offset++] = '/'; }
|
||||
else if (m_urlBuffer[m_offset - 1] != '/') { m_urlBuffer[m_offset++] = '/'; }
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user