diff --git a/src/detection/publicip/publicip.c b/src/detection/publicip/publicip.c index 4c1cdc42f..5475fdb4d 100644 --- a/src/detection/publicip/publicip.c +++ b/src/detection/publicip/publicip.c @@ -69,5 +69,6 @@ const char* ffDetectPublicIp(FFPublicIpOptions* options, FFPublicIpResult* resul ffStrbufDestroy(&result->ip); ffStrbufInitMove(&result->ip, &response); + ffStrbufTrimRightSpace(&result->ip); return NULL; } diff --git a/src/detection/weather/weather.c b/src/detection/weather/weather.c index 94bd6b5b6..544105a62 100644 --- a/src/detection/weather/weather.c +++ b/src/detection/weather/weather.c @@ -29,7 +29,11 @@ const char* ffDetectWeather(FFWeatherOptions* options, FFstrbuf* result) ffStrbufEnsureFree(result, 4095); bool success = ffNetworkingRecvHttpResponse(&state, result, options->timeout); - if (success) ffStrbufSubstrAfterFirstS(result, "\r\n\r\n"); + if (success) + { + ffStrbufSubstrAfterFirstS(result, "\r\n\r\n"); + ffStrbufTrimRightSpace(result); + } if(!success || result->length == 0) return "Failed to receive the server response";