rejetto forum
Software => HFS ~ HTTP File Server => Programmers corner => Topic started by: Mars on April 30, 2009, 01:09:49 PM
-
Am I right to add:
procedure load(fn:string; varname:string='');
begin
if ansiStartsText('http://', fn) or ansiStartsText('https://', p) then result:=httpGet(fn)
else result:=loadFile(uri2diskMaybe(fn));
.......
if name = 'filesize' then
begin
if ansiStartsText('http://', p) or ansiStartsText('https://', p) then i:=httpFileSize(p)
else i:=sizeOfFile(uri2diskMaybe(p));
result:=intToStr(max(0,i));
end;
Otherwise macros load and filesize cannot work through ssl with https://......
;)
-
it makes sense only if httpget and httpfilesize work over https.
do they?
-
it makes sense only if httpget and httpfilesize work over https.
do they?
The probability of such an event is not invalid. It seems to me necessary to make this modification, because it is not excluded having to load a file or its size from a typical server with ssl support
-
i will reply to my question: No, they don't support https yet. :)
but ok, we'll put that code for the future, there are no bad side effects.
-
if name = 'load' then
load(par(0), par(1,'var'));
procedure load(fn:string; varname:string='');
begin
if reMatch(p, '^https?://', 'i!') > 0 then
result:=httpGet(fn)
else
result:=loadFile(uri2diskMaybe(fn));
if anyCharIn('/\',fn) then result:=macroQuote(result);
?????????
if name = 'load' then
load(p, par(1,'var'));
procedure load(fn:string; varname:string='');
begin
if reMatch(fn, '^https?://', 'i!') > 0 then
result:=httpGet(fn)
else
result:=loadFile(uri2diskMaybe(fn));
if anyCharIn('/\',fn) then result:=macroQuote(result);
or
if name = 'load' then
load(par(1,'var'));
procedure load(varname:string='');
begin
if reMatch(p, '^https?://', 'i!') > 0 then
result:=httpGet(p)
else
result:=loadFile(uri2diskMaybe(p));
if anyCharIn('/\',p) then result:=macroQuote(result);
;)
-
right
fixed :)