Downloader class now properly URLencodes paths

This commit is contained in:
Thulinma 2017-12-13 16:37:34 +01:00
parent fb88d214fb
commit bd1b1be37e

View file

@ -1,6 +1,7 @@
#include "downloader.h" #include "downloader.h"
#include "defines.h" #include "defines.h"
#include "timing.h" #include "timing.h"
#include "encode.h"
namespace HTTP{ namespace HTTP{
@ -103,7 +104,7 @@ namespace HTTP{
H.SetHeader("Host", proxyUrl.host); H.SetHeader("Host", proxyUrl.host);
} }
}else{ }else{
H.url = "/" + link.path; H.url = "/" + Encodings::URL::encode(link.path);
if (link.args.size()){H.url += "?" + link.args;} if (link.args.size()){H.url += "?" + link.args;}
if (link.port.size()){ if (link.port.size()){
H.SetHeader("Host", link.host + ":" + link.port); H.SetHeader("Host", link.host + ":" + link.port);