halflife icon indicating copy to clipboard operation
halflife copied to clipboard

FastDL does not URLEncode the request URI

Open SamVanheer opened this issue 7 years ago • 1 comments

When the FastDL download manager sends the HTTP request to download a file it does not URLEncode the URI which can result in files with spaces or other unsupported characters not downloading (properly).

The URI should be encoded in DownloadManager::StartNewDownload before passing the complete URI into ISteamHTTP::CreateHTTPRequest.

The documentation for that method makes no mention of URL encoding so i assume it does not do this internally. Since downloads with spaces fail, this reinforces the assumption.

SamVanheer avatar Nov 18 '18 18:11 SamVanheer

Unable to download files with spaces from server.

Issue transferred from https://github.com/ValveSoftware/halflife/issues/3274. @MaNaReaver posted on 2022-05-23T21:39:19:

If a map/plugin precaches a file that has spaces in them, it wouldn't be downloaded as it divides the file into multiple files, a space being the delimiter. This prevents players from joining the server as they're stuck in a "Verifying resources..." loop until a map restart is issued. Mappers therefore usually add resources that do not have spaces as delimiters in them, but some forget to make the changes.

For example, a map like ze_countryroads requires the following file to run:

sound/ze_countryroads/Warriyo - Mortals.wav

However, the player cannot download this file from a multiplayer server, as it's split up into the following:

Error: server failed to transmit file 'sound/ze_countryroads/Warriyo' Error: server failed to transmit file '-' Error: server failed to transmit file 'Mortals.wav'

A usual solution is to edit the BSP and remove the spaces in the precached file, however it's cumbersome to do for many such maps. A good solution for the engine would be to replace spaces to %20 such that the file can be downloaded correctly instead of being broken down.

kisak-valve avatar May 23 '22 21:05 kisak-valve