speedtest-desktop icon indicating copy to clipboard operation
speedtest-desktop copied to clipboard

Problem recognizing a local server using debian 12 apache

Open hugleo opened this issue 2 years ago • 1 comments

Facing problems with Speedtest-desktop detecting my local host server when using apache (perhaps the problem is only with new apache versions). The error occurs when speedtest-desktop attempts to request the empty.php file, resulting in a "400 Bad Request" error.

I attempted to mimic the speedtest-desktop request using curl and occur the same error.

curl -X GET \
     -H "GET /empty.php HTTP/1.1\r\n" \
     -H "Host: 192.168.0.1\r\n" \
     -H "User-Agent: Librespeed-Desktop/1.0\r\n" \
     -H "Connection: keep-alive\r\n" \
     -H "Accept-Encoding: identity\r\n" \
     -H "Accept-Language: en_US\r\n" \
     http://192.168.0.1/empty.php

The issue was due to the \r\n characters at the end of the hostname in the "Host" header.

I've changed the curl command as follows:

curl -X GET \
     -H "GET /empty.php HTTP/1.1\r\n" \
     -H "Host: 192.168.0.1" \
     -H "User-Agent: Librespeed-Desktop/1.0\r\n" \
     -H "Connection: keep-alive\r\n" \
     -H "Accept-Encoding: identity\r\n" \
     -H "Accept-Language: en_US\r\n" \
     http://192.168.0.1/empty.php

This modification allowed the request to work successfully.

Don't know if is a problem with Speedtest-desktop or apache.

Currently I have switched to using Nginx and everything is working normally.

hugleo avatar Nov 18 '23 15:11 hugleo

Hello. thank you for report this issue. speedtest-desktop uses exactly the same core library as speedtest-android. Is this problem in the Android version as well ?

SudoDios avatar Nov 24 '23 06:11 SudoDios