Skip to content

Commit

Permalink
Added HTTPS support to downloadFile method
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris7 authored and chris7 committed Jan 30, 2013
1 parent 2b355dc commit 0053fd1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/TLuaInterpreter.cpp 100644 → 100755
Expand Up @@ -24,6 +24,7 @@
#include <QString>
#include <QRegExp>
#include <QNetworkAccessManager>
#include <QSslConfiguration>
#include <QDesktopServices>
#include "TLuaInterpreter.h"
#include "TForkedProcess.h"
Expand Down Expand Up @@ -7684,8 +7685,13 @@ int TLuaInterpreter::downloadFile( lua_State * L )
Host * pHost = TLuaInterpreter::luaInterpreterMap[L];
QString _url = url.c_str();
QString _path = path.c_str();

QNetworkReply * reply = pHost->mLuaInterpreter.mpFileDownloader->get( QNetworkRequest( QUrl( _url ) ) );
QNetworkRequest request = QNetworkRequest( QUrl( _url ) );
if ( _path.contains("https") )
{
QSslConfiguration config( QSslConfiguration::defaultConfiguration() );
request.setSslConfiguration( config );
}
QNetworkReply * reply = pHost->mLuaInterpreter.mpFileDownloader->get( request );
pHost->mLuaInterpreter.downloadMap[reply] = _path;
return 0;

Expand Down

0 comments on commit 0053fd1

Please sign in to comment.