RTC Forums

Subscription => Support => Topic started by: GeirBerg on May 27, 2015, 11:46:55 AM



Title: Get fragment part (#) of URI from TRtcServerRequest
Post by: GeirBerg on May 27, 2015, 11:46:55 AM
Hi.

We need to extract and validate some GET parameters from a request but are unable to do so since it seems that anything that comes after a fragment identifier (#) in a URI is not available in any of the usual properties (URI, FileName, Query.Text, Params.Text, etc.).

So how do we get access to the complete (original) URI so that we can parse it?

Here is an example of an URI with a fragment:

https://<server:port>/index.html#/login?customerid=123&userid=abc&password=secret&...

Without the # we can easily extract the value with Query[...] or Query.Text

Thank you in advance!


Title: Re: Get fragment part (#) of URI from TRtcServerRequest
Post by: D.Tkalcec (RTC) on May 28, 2015, 08:24:41 AM
What you are probably looking for is the "Referer" parameter in the HTTP Header (accessible through Request['Referer'] or the Request.Referer property). The referer is extracted by the WebBrowser from the fragment part of the URI contained in a HTML page, but you can NOT simply enter an URL with a fragment part into the Address line of a WebBrowser for testing, because most WebBrowsers will simply cut off anything behind '#' when entered directly into the Address line.

Best Regards,
Danijel Tkalcec


Title: Re: Get fragment part (#) of URI from TRtcServerRequest
Post by: GeirBerg on May 28, 2015, 08:39:14 AM
Hmm. I'm sure you're right. We were hoping to detect old client versions based on certain parameters, but since the client uses an embedded Chromium webbrowser it seems that fragment parts are never sent. I see now that this is by design (RFC spec?) in all browsers. So I guess we'll have to find another way.

UPDATE: I think you updated your answer while I was writing a reply. However, the "Referer" property does not seem to help in this case. What you say regarding browsers seems to match with my findings.

Anyway, thank you for your reply.