Skip to content

Commit 0594d27

Browse files
authored
Merge pull request #109 from CESNET/HTTPS_plugin_fix
BUGFIX: Removed trailing '\r' from HTTP exported fields
2 parents 2bc4dfc + 3ad662d commit 0594d27

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

process/http.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,15 @@ void copy_str(char *dst, ssize_t size, const char *begin, const char *end)
180180
}
181181

182182
memcpy(dst, begin, len);
183+
184+
if (len >= 1 && dst[len - 1] == '\n') {
185+
len--;
186+
}
183187

184-
if (len >= 2 && dst[len - 1] == '\n' && dst[len - 2] == '\r') {
185-
len -= 2;
188+
if (len >= 1 && dst[len - 1] == '\r') {
189+
len--;
186190
}
191+
187192
dst[len] = 0;
188193
}
189194

0 commit comments

Comments
 (0)