From: konrad Date: Mon, 17 Sep 2007 20:11:42 +0000 (+0000) Subject: fix http requests X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=f13ec237675cf0a325ce4ad6f44c6f92bcb59a2e;p=web%2Fkonrad%2Fsmoke.git fix http requests git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@29 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33 --- diff --git a/src/webrequest.cpp b/src/webrequest.cpp index 2e51976..9bc9989 100644 --- a/src/webrequest.cpp +++ b/src/webrequest.cpp @@ -46,8 +46,12 @@ bool MWebRequest::request(QString hreq,QByteArray data) else conm=QHttp::ConnectionModeHttps; req.setHost(url.host(),conm,port); if(proxyport>0)req.setProxy(proxyname,proxyport,proxyuser,proxypass); - QHttpRequestHeader hrh("POST","/~konrad/smoke/machine.php"); - hrh.setValue("Host","localhost"); + QString pathspec=url.path();if(pathspec=="")pathspec="/"; + if(url.encodedQuery()!="")pathspec+="?"+url.encodedQuery(); + QHttpRequestHeader hrh("POST",url.path()); + QString hostspec=url.host(); + if(url.port()>0)hostspec+=":"+QString::number(port); + hrh.setValue("Host",hostspec); hrh.setValue("X-MagicSmoke-Request",hreq); hrh.setValue("X-MagicSmoke-Session",sessionid); hrh.setContentLength(data.size());