rejetto forum

http:// only ?

Mars · 6 · 1951

0 Members and 1 Guest are viewing this topic.

Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2039
    • View Profile
Am I right to add:

Quote
  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://......
 ;)
« Last Edit: May 12, 2009, 02:10:25 PM by mars »


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13308
    • View Profile
it makes sense only if httpget and httpfilesize work over https.
do they?


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2039
    • View Profile
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


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13308
    • View Profile
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.


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2039
    • View Profile
Quote
   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);

?????????

Quote
   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

Quote
   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);

 ;)


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13308
    • View Profile