Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Detecting /# in an URL

JDamianB
Altostratus
Altostratus

Hi

I created an iRule to permit/deny the access to the URL /#/admin according to the client address.

My problem is neither [HTTP::uri] nor [HTTP::path] contain  #/admin

I observed navigators and curl "removes" the # and its trailing part (#/admin) from the GET

GET / HTTP1.1

But, on the other hand, the page retrieved from / is different to the one from /#/admin, then, somehow #/admin reaches the server and shows different HTML, doesn't it?

I'm confused.

How to make the iRule detect /#/admin?

 

1 ACCEPTED SOLUTION

As I suspected, the #/admin is processed in the client side and it is not sent to the server. The next wikipedia article explains the use of fragments:

https://en.wikipedia.org/wiki/URI_fragment

View solution in original post

3 REPLIES 3

Hi Marycasey

But it seems the Referer is empty.

I added these two lines to my iRule

set referer [HTTP::header Referer]
log "REFERER: $referer"

and nothing appears after REFERER: in the /var/log/ltm

 

Thanks anyway

 

P.D: the response from the server contains  "Referrer-Policy: no-referrer"

 

Hi

I have found  #/admin  in a JavaScript created by, I think, AngularJS

<a href="#/admin/contexts" data-ng-class="{\'active\': location.path() === \'/admin/contexts\'}" >

As I suspected, the #/admin is processed in the client side and it is not sent to the server. The next wikipedia article explains the use of fragments:

https://en.wikipedia.org/wiki/URI_fragment