mitre / HTTP-Proxy-Servlet

Smiley's HTTP Proxy implemented as a Java servlet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

kibana url was truncated when it has '#'

assassinwardon opened this issue · comments

Hi,

I met a problem when test proxy kibana links.

The original url is below:
http://192.168.13.132:30243/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now))&_a=(columns:!(),filters:!(),index:'79990690-4cca-11ed-9d6c-6df45437727a',interval:auto,query:(language:kuery,query:''),sort:!(!('@timestamp',desc)))

and log in console shows url after proxy changed into:
http://192.168.13.132:30243/app/discover

Attach configuration:

proxy:
  kibana:
    servlet_url: /kibana/*
    target_url: http://192.168.13.132:30243

<iframe width="1920"height="1080" src="http://192.168.0.113:8080/kibana/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now))&_a=(columns:!(),filters:!(),index:'79990690-4cca-11ed-9d6c-6df45437727a',interval:auto,query:(language:kuery,query:''),sort:!(!('@timestamp',desc)))"></iframe>

and logs:
2022-10-16 11:06:44.962 INFO 20836 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : grafanaProxyServlet: proxy GET uri: /kibana/app/discover -- http://192.168.13.132:30243/app/discover

And I tried urlencode '#' into '%23'.
<iframe width="1920"height="1080" src="http://192.168.0.113:8080/kibana/app/discover%23/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now))&_a=(columns:!(),filters:!(),index:'79990690-4cca-11ed-9d6c-6df45437727a',interval:auto,query:(language:kuery,query:''),sort:!(!('@timestamp',desc)))"></iframe>
The result changed to:
2022-10-16 11:23:16.298 INFO 20836 --- [nio-8080-exec-2] o.a.c.c.C.[Tomcat].[localhost].[/] : grafanaProxyServlet: proxy GET uri: /kibana/app/discover%23/ -- http://192.168.13.132:30243/app/discover%23/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now))&_a=(columns:!(),filters:!(),index:%2779990690-4cca-11ed-9d6c-6df45437727a%27,interval:auto,query:(language:kuery,query:%27%27),sort:!(!(%27@timestamp%27,desc)))

I use version 1.12.1.

<dependency>
    <groupId>org.mitre.dsmiley.httpproxy</groupId>
    <artifactId>smiley-http-proxy-servlet</artifactId>
    <version>1.12.1</version>
</dependency>

Looking for your reply.
Thanks in advance.

The pound sign in a URL demarcates the so-called "fragment" that follows. The browser shouldn't send it to the server, and thus the proxy or any server for that matter doesn't see it.
https://blog.httpwatch.com/2011/03/01/6-things-you-should-know-about-fragment-urls/