Jump to content

Read request header from UniSession


MassimoD

Recommended Posts

Hi,

i've this header sent from IIS to uniGui Service and readed from ARequestInfo.RawHeaders.Text in UniGUIServerModuleHTTPCommand:

Connection: Keep-Alive
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.5
Host: localhost:9090
Max-Forwards: 10
Referer: http://audiosales.devweb-01/
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:107.0) Gecko/20100101 Firefox/107.0
X-Requested-With: XMLHttpRequest
Origin: http://audiosales.devweb-01
X-Original-URL: /HandleEvent
PROPRIETARIO: audiosales
X-Forwarded-For: 192.168.70.1:53696
X-ARR-LOG-ID: b356a7d1-071a-4c8a-add8-e118d477127c
Content-Length: 147

How can i read Origin or Referer header?

I can read other header, but i can't get one of those.

In my case:

UniApplication.UniSession.RequestHeader['PROPRIETARIO'] -> Work
UniApplication.UniSession.RequestHeader['X-Forwarded-For'] -> Work
UniApplication.UniSession.RequestHeader['Origin'] -> Not work
UniApplication.UniSession.RequestHeader['Referer'] -> Not work

 

Link to comment
Share on other sites

10 hours ago, MassimoD said:

Hi,

i've this header sent from IIS to uniGui Service and readed from ARequestInfo.RawHeaders.Text in UniGUIServerModuleHTTPCommand:

Connection: Keep-Alive
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.5
Host: localhost:9090
Max-Forwards: 10
Referer: http://audiosales.devweb-01/
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:107.0) Gecko/20100101 Firefox/107.0
X-Requested-With: XMLHttpRequest
Origin: http://audiosales.devweb-01
X-Original-URL: /HandleEvent
PROPRIETARIO: audiosales
X-Forwarded-For: 192.168.70.1:53696
X-ARR-LOG-ID: b356a7d1-071a-4c8a-add8-e118d477127c
Content-Length: 147

How can i read Origin or Referer header?

I can read other header, but i can't get one of those.

In my case:

UniApplication.UniSession.RequestHeader['PROPRIETARIO'] -> Work
UniApplication.UniSession.RequestHeader['X-Forwarded-For'] -> Work
UniApplication.UniSession.RequestHeader['Origin'] -> Not work
UniApplication.UniSession.RequestHeader['Referer'] -> Not work

 

Hello, try to get info in UniGUIServerModuleHTTPCommand

IF ARequestInfo.RawHeaders.Values ['Origin'] <> '' then
    Dialogs.ShowMessage (ARequestInfo.RawHeaders.Values ['Origin']);

AND ARequestInfo.Referer

 

But can you explain why it is important to you, is it some security reasons?

Link to comment
Share on other sites

i try to get it from mainModule or Main form.

I need it because my application run under iis reverse proxy that is called from many different address like:

- subdom1.mydomain.com

- subdom2.mydomain.com

...

IIS reverse proxy receive request from all those urls and redirect all to localhost where unigui is active.

So in unigui i need to know from wich url the connection come.

i've pasted in my first post all the headers that iis transfer to localhost unigui and i can catch it on UniGUIServerModuleHTTPCommand, but seem that not all was propagated to other component in session.

 

Many thanks.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...