mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2025-11-25 04:41:33 +03:00
Add custom HTTP header feature for HTTP proxy
A custom HTTP header can be used to bypass certain restrictions imposed on the network or to avoid speed limitations applied by the QoS.
This commit is contained in:
@ -2027,6 +2027,53 @@ void EnSafeStr(char *str, char replace)
|
||||
}
|
||||
}
|
||||
|
||||
// Replace '\r' and '\n' with the specified character.
|
||||
// If the specified character is a space (unsafe), the original character is removed.
|
||||
void EnSafeHttpHeaderValueStr(char *str, char replace)
|
||||
{
|
||||
UINT length = 0;
|
||||
UINT index = 0;
|
||||
|
||||
// Validate arguments
|
||||
if (str == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
length = StrLen(str);
|
||||
while (index < length)
|
||||
{
|
||||
if (str[index] == '\r' || str[index] == '\n')
|
||||
{
|
||||
if (replace == ' ')
|
||||
{
|
||||
Move(&str[index], &str[index + 1], length - index);
|
||||
}
|
||||
else
|
||||
{
|
||||
str[index] = replace;
|
||||
}
|
||||
}
|
||||
else if (str[index] == '\\')
|
||||
{
|
||||
if (str[index + 1] == 'r' || str[index + 1] == 'n')
|
||||
{
|
||||
if (replace == ' ')
|
||||
{
|
||||
Move(&str[index], &str[index + 2], length - index);
|
||||
index--;
|
||||
}
|
||||
else
|
||||
{
|
||||
str[index] = str[index + 1] = replace;
|
||||
index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
// Operation check of string library
|
||||
bool CheckStringLibrary()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user