Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Read HTTP Header Field "Host"
#1
Hi,

we have an Intraweb Site (standalone application) where we would like to use TLS (HTTPS) encryption. We are planning to use two domains which will point to the same IP. The Intraweb application should react differently depending from which domain the request is coming (show different pages and use different certification files since certificates are depending on domain?)
I was told to use the HTTP Header Field "Host". How can I read this header field in Intraweb?
Reply
#2
Hi, if you use iw 15+ with http.sys you be able to have a lot of applications running in same Domainserver with one certificate. Ex:
www.mysyte.com/app1/
www.mysyte.com/app2/
www.mysyte.com/etc/

And you have one certificate:
www.mysyte.com

Because http.sys use the same Domain information registered on windows with IIS or without IIS (directly via prompt).
Reply
#3
Thank you, but how can I access the HTTP Header in Intraweb? Is it possible?
Reply
#4
Hi, you have information you can handle like this:
uses
  IW.HTTP.Request

Code:
procedure TIWServerController.IWServerControllerBaseNewSession(aSession: TIWApplication);
begin
   ASession.Data := TIWUserSession.Create(nil, aSession);

   { Use ASession.Request to obtain a lot of information }
   if ASession.Request.HttpMethod = hmNone then begin
      ASession.Response.Code     := 405;
      ASession.Response.CodeText := 'Not Allowed';
      ASession.Terminate;
   end;
end;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)