Commit bd8e9334 authored by Christopher Mueller's avatar Christopher Mueller Committed by Hugo Beauzée-Luyssen

dash: set segment url relative if url is not valid

Signed-off-by: default avatarHugo Beauzée-Luyssen <beauze.h@gmail.com>
parent 89dd589d
......@@ -74,8 +74,16 @@ int HTTPConnection::peek (const uint8_t **pp_peek, size_t
}
void HTTPConnection::parseURL ()
{
this->hostname = this->url;
this->hostname.erase(0, 7);
if(this->url.compare(0, 4, "http"))
{
this->hostname = Helper::combinePaths(Helper::getDirectoryPath(stream->psz_path), this->url);
}
else
{
this->hostname = this->url;
this->hostname.erase(0, 7);
}
this->path = this->hostname;
size_t pos = this->hostname.find("/");
......
......@@ -37,6 +37,7 @@
#include "http/IHTTPConnection.h"
#include "http/Chunk.h"
#include "Helper.h"
#define PEEKBUFFER 4096
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment