mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 11:17:57 +08:00
Issue #1215: modify original url variable so error messages show the right one
This commit is contained in:
@ -3312,7 +3312,6 @@ var
|
|||||||
UserAgent, OS: String;
|
UserAgent, OS: String;
|
||||||
HttpStatus: Integer;
|
HttpStatus: Integer;
|
||||||
ContentChunk: UTF8String;
|
ContentChunk: UTF8String;
|
||||||
InsecureUrl: String;
|
|
||||||
begin
|
begin
|
||||||
DoStore := False;
|
DoStore := False;
|
||||||
if MainForm.IsWine then
|
if MainForm.IsWine then
|
||||||
@ -3332,9 +3331,9 @@ begin
|
|||||||
UrlHandle := InternetOpenURL(NetHandle, PChar(FURL), nil, 0, INTERNET_FLAG_RELOAD, 0);
|
UrlHandle := InternetOpenURL(NetHandle, PChar(FURL), nil, 0, INTERNET_FLAG_RELOAD, 0);
|
||||||
if (not Assigned(UrlHandle)) and FURL.StartsWith('https:', true) then begin
|
if (not Assigned(UrlHandle)) and FURL.StartsWith('https:', true) then begin
|
||||||
// Try again without SSL. See issue #65 and #1209
|
// Try again without SSL. See issue #65 and #1209
|
||||||
InsecureUrl := ReplaceRegExpr('^https:', FURL, 'http:');
|
|
||||||
MainForm.LogSQL(f_('Could not open %s (%s) - trying again without SSL...', [FURL, SysErrorMessage(Windows.GetLastError)]), lcError);
|
MainForm.LogSQL(f_('Could not open %s (%s) - trying again without SSL...', [FURL, SysErrorMessage(Windows.GetLastError)]), lcError);
|
||||||
UrlHandle := InternetOpenURL(NetHandle, PChar(InsecureUrl), nil, 0, INTERNET_FLAG_RELOAD, 0);
|
FURL := ReplaceRegExpr('^https:', FURL, 'http:');
|
||||||
|
UrlHandle := InternetOpenURL(NetHandle, PChar(FURL), nil, 0, INTERNET_FLAG_RELOAD, 0);
|
||||||
end;
|
end;
|
||||||
if not Assigned(UrlHandle) then begin
|
if not Assigned(UrlHandle) then begin
|
||||||
raise Exception.CreateFmt(_('Could not open %s (%s)'), [FURL, SysErrorMessage(Windows.GetLastError)]);
|
raise Exception.CreateFmt(_('Could not open %s (%s)'), [FURL, SysErrorMessage(Windows.GetLastError)]);
|
||||||
|
Reference in New Issue
Block a user