01-28-2022, 06:32 AM
(01-27-2022, 09:18 PM)Alexandre Machado Wrote:(01-27-2022, 07:45 AM)magosk Wrote: Thanks for the explanation Alexandre!
(Yes, this was a sync call). Rather than removing it, I have modified my code so that it works with both older and newer versions of IntraWeb.
/Magnus
Can you please let me know how you changed it? It may be important for me to understand what your issue was
I just did this modification, so that the code would still work with IW 15.1 and prior, but do no change to the response in IW 15.2 when it is already a redirect (I guess the issue was that a duplicate Location header was created before):
Code:
procedure ChangeResponseCodeFromOKToRedirect(const URL: string);
begin
if (WebApplication.Response.Code < 301) or (WebApplication.Response.Code > 303) then
WebApplication.Response.Code := 302;
if WebApplication.Response.Headers.IndexOfName('Location') < 0 then
WebApplication.Response.AddHeader('Location', URL);
end{procedure};
