Double Slash Support in Tomcat 9.0.27

classic Classic list List threaded Threaded
28 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Double Slash Support in Tomcat 9.0.27

Kushagra Bindal
Hi,

We are working on upgrading our enterprise application from 8.5.24 to
9.0.27 version.

What we have observed that in earlier version i.e. 8.5.24 we were able to
process process a REST URI have  double slash ("//") in it.

But when we are upgrading it to 9.0.27 we found that now the same url which
was working earlier it is now throwing 404 status code.

Now, the problem is that we can not remove these double slash (//) manually
as it is used widely.

So, can someone please provide a possible solution of this issue?

--
Regards,
Kushagra Bindal
+91-9013792807
Reply | Threaded
Open this post in threaded view
|

Re: Double Slash Support in Tomcat 9.0.27

M. Manna
HI,


On Fri, 29 Nov 2019 at 09:00, Kushagra Bindal <[hidden email]>
wrote:

> Hi,
>
> We are working on upgrading our enterprise application from 8.5.24 to
> 9.0.27 version.
>
> What we have observed that in earlier version i.e. 8.5.24 we were able to
> process process a REST URI have  double slash ("//") in it.
>
> But when we are upgrading it to 9.0.27 we found that now the same url which
> was working earlier it is now throwing 404 status code.
>
> Now, the problem is that we can not remove these double slash (//) manually
> as it is used widely.
>
> So, can someone please provide a possible solution of this issue?
>

 Tomcat processes HTTP query and URL using RFC 7230 standards. But multiple
leading forward slash support was disabled by default for good reasons.
This was done in 8.5.31 due to issues with Http Redirects involving
Servlets.

If you must use this, you have to modify your application context to add
the override as true - the attribute is called
"allowMultipleLeadingForwardSlashInPath".

https://tomcat.apache.org/tomcat-8.5-doc/config/context.html

But I would sincerely recommend that you work on such designs and correct
them in your application. There is always a "way". This is one of the
reasons web applications become obsolete requires huge maintenance.

Thanks,

>
> --
> Regards,
> Kushagra Bindal
> +91-9013792807
>
Reply | Threaded
Open this post in threaded view
|

Re: Double Slash Support in Tomcat 9.0.27

Mark Thomas-2
In reply to this post by Kushagra Bindal
On 29/11/2019 09:00, Kushagra Bindal wrote:

> Hi,
>
> We are working on upgrading our enterprise application from 8.5.24 to
> 9.0.27 version.
>
> What we have observed that in earlier version i.e. 8.5.24 we were able to
> process process a REST URI have  double slash ("//") in it.
>
> But when we are upgrading it to 9.0.27 we found that now the same url which
> was working earlier it is now throwing 404 status code.
>
> Now, the problem is that we can not remove these double slash (//) manually
> as it is used widely.
>
> So, can someone please provide a possible solution of this issue?

Can you provide more details such as:
- an example request URI
- the <url-pattern> for the servlet you expect it to match to

Thanks,

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Double Slash Support in Tomcat 9.0.27

Kushagra Bindal
In reply to this post by M. Manna
Hi Mark,

Thanks for providing the response.

Yes, you are right that we should design our application to remove // from
being used.

I will plan it accordingly, for the provided solution in below. Let me try
the same and I will revert back to you in case of any further queries and
concerns.

On Fri, Nov 29, 2019 at 2:56 PM M. Manna <[hidden email]> wrote:

> HI,
>
>
> On Fri, 29 Nov 2019 at 09:00, Kushagra Bindal <[hidden email]>
> wrote:
>
> > Hi,
> >
> > We are working on upgrading our enterprise application from 8.5.24 to
> > 9.0.27 version.
> >
> > What we have observed that in earlier version i.e. 8.5.24 we were able to
> > process process a REST URI have  double slash ("//") in it.
> >
> > But when we are upgrading it to 9.0.27 we found that now the same url
> which
> > was working earlier it is now throwing 404 status code.
> >
> > Now, the problem is that we can not remove these double slash (//)
> manually
> > as it is used widely.
> >
> > So, can someone please provide a possible solution of this issue?
> >
>
>  Tomcat processes HTTP query and URL using RFC 7230 standards. But multiple
> leading forward slash support was disabled by default for good reasons.
> This was done in 8.5.31 due to issues with Http Redirects involving
> Servlets.
>
> If you must use this, you have to modify your application context to add
> the override as true - the attribute is called
> "allowMultipleLeadingForwardSlashInPath".
>
> https://tomcat.apache.org/tomcat-8.5-doc/config/context.html
>
> But I would sincerely recommend that you work on such designs and correct
> them in your application. There is always a "way". This is one of the
> reasons web applications become obsolete requires huge maintenance.
>
> Thanks,
>
> >
> > --
> > Regards,
> > Kushagra Bindal
> > +91-9013792807
> >
>


--
Regards,
Kushagra Bindal
+91-9013792807
Reply | Threaded
Open this post in threaded view
|

Re: Double Slash Support in Tomcat 9.0.27

Kushagra Bindal
Hi Mark,

We tried to put the changes as suggested by you. Below are the changes that
we have made in context.xml file.

<Context *allowMultipleLeadingForwardSlashInPath="true"*>

    <!-- Default set of monitored resources. If one of these changes, the
 -->
    <!-- web application will be reloaded.
  -->
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    <WatchedResource>WEB-INF/tomcat-web.xml</WatchedResource>
    <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>

    <ResourceLink name="jdbc/edbDataSource" global="jdbc/edbDataSource"
type="javax.sql.DataSource"/>

    <CookieProcessor
className="org.apache.tomcat.util.http.LegacyCookieProcessor" />

    <!-- Uncomment this to disable session persistence across Tomcat
restarts -->
    <!--
    <Manager pathname="" />
    -->

    <!-- Uncomment this to enable Comet connection tacking (provides events
         on session expiration as well as webapp lifecycle) -->
    <!--
    <Valve
className="org.apache.catalina.valves.CometConnectionManagerValve" />
    -->
</Context>

But after restart still I am getting below errors in tomcat's
*localhost_access_log.2019-11-29.txt* file.

172.18.0.3 - - [29/Nov/2019:11:27:45 +0000] "GET
/sdm/restcall/v1/platform//healthCheck HTTP/1.0" 404 -
172.18.0.3 - - [29/Nov/2019:11:27:45 +0000] "GET
/sdm/restcall/v1/platform//healthCheck HTTP/1.0" 404 -
172.18.0.3 - - [29/Nov/2019:11:27:46 +0000] "GET
/sdm/restcall/v1/platform//healthCheck HTTP/1.0" 404 -

Please help me in correcting the syntax.

Regards
Kushagra

On Fri, Nov 29, 2019 at 4:02 PM Kushagra Bindal <[hidden email]>
wrote:

> Hi Mark,
>
> Thanks for providing the response.
>
> Yes, you are right that we should design our application to remove // from
> being used.
>
> I will plan it accordingly, for the provided solution in below. Let me try
> the same and I will revert back to you in case of any further queries and
> concerns.
>
> On Fri, Nov 29, 2019 at 2:56 PM M. Manna <[hidden email]> wrote:
>
>> HI,
>>
>>
>> On Fri, 29 Nov 2019 at 09:00, Kushagra Bindal <[hidden email]>
>> wrote:
>>
>> > Hi,
>> >
>> > We are working on upgrading our enterprise application from 8.5.24 to
>> > 9.0.27 version.
>> >
>> > What we have observed that in earlier version i.e. 8.5.24 we were able
>> to
>> > process process a REST URI have  double slash ("//") in it.
>> >
>> > But when we are upgrading it to 9.0.27 we found that now the same url
>> which
>> > was working earlier it is now throwing 404 status code.
>> >
>> > Now, the problem is that we can not remove these double slash (//)
>> manually
>> > as it is used widely.
>> >
>> > So, can someone please provide a possible solution of this issue?
>> >
>>
>>  Tomcat processes HTTP query and URL using RFC 7230 standards. But
>> multiple
>> leading forward slash support was disabled by default for good reasons.
>> This was done in 8.5.31 due to issues with Http Redirects involving
>> Servlets.
>>
>> If you must use this, you have to modify your application context to add
>> the override as true - the attribute is called
>> "allowMultipleLeadingForwardSlashInPath".
>>
>> https://tomcat.apache.org/tomcat-8.5-doc/config/context.html
>>
>> But I would sincerely recommend that you work on such designs and correct
>> them in your application. There is always a "way". This is one of the
>> reasons web applications become obsolete requires huge maintenance.
>>
>> Thanks,
>>
>> >
>> > --
>> > Regards,
>> > Kushagra Bindal
>> > +91-9013792807
>> >
>>
>
>
> --
> Regards,
> Kushagra Bindal
> +91-9013792807
>


--
Regards,
Kushagra Bindal
+91-9013792807
Reply | Threaded
Open this post in threaded view
|

Re: Double Slash Support in Tomcat 9.0.27

M. Manna
Hi

On Fri, 29 Nov 2019 at 11:43, Kushagra Bindal <[hidden email]>
wrote:

> Hi Mark,
>
> We tried to put the changes as suggested by you. Below are the changes that
> we have made in context.xml file.
>
> <Context *allowMultipleLeadingForwardSlashInPath="true"*>


Why this asterisk? *

>
>
>     <!-- Default set of monitored resources. If one of these changes, the
>  -->
>     <!-- web application will be reloaded.
>   -->
>     <WatchedResource>WEB-INF/web.xml</WatchedResource>
>     <WatchedResource>WEB-INF/tomcat-web.xml</WatchedResource>
>     <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
>
>     <ResourceLink name="jdbc/edbDataSource" global="jdbc/edbDataSource"
> type="javax.sql.DataSource"/>
>
>     <CookieProcessor
> className="org.apache.tomcat.util.http.LegacyCookieProcessor" />
>
>     <!-- Uncomment this to disable session persistence across Tomcat
> restarts -->
>     <!--
>     <Manager pathname="" />
>     -->
>
>     <!-- Uncomment this to enable Comet connection tacking (provides events
>          on session expiration as well as webapp lifecycle) -->
>     <!--
>     <Valve
> className="org.apache.catalina.valves.CometConnectionManagerValve" />
>     -->
> </Context>
>
> But after restart still I am getting below errors in tomcat's
> *localhost_access_log.2019-11-29.txt* file.
>
> 172.18.0.3 - - [29/Nov/2019:11:27:45 +0000] "GET
> /sdm/restcall/v1/platform//healthCheck HTTP/1.0" 404 -
> 172.18.0.3 - - [29/Nov/2019:11:27:45 +0000] "GET
> /sdm/restcall/v1/platform//healthCheck HTTP/1.0" 404 -
> 172.18.0.3 - - [29/Nov/2019:11:27:46 +0000] "GET
> /sdm/restcall/v1/platform//healthCheck HTTP/1.0" 404 -
>
> Please help me in correcting the syntax.
>
> Regards
> Kushagra
>
> On Fri, Nov 29, 2019 at 4:02 PM Kushagra Bindal <[hidden email]
> >
> wrote:
>
> > Hi Mark,
> >
> > Thanks for providing the response.
> >
> > Yes, you are right that we should design our application to remove //
> from
> > being used.
> >
> > I will plan it accordingly, for the provided solution in below. Let me
> try
> > the same and I will revert back to you in case of any further queries and
> > concerns.
> >
> > On Fri, Nov 29, 2019 at 2:56 PM M. Manna <[hidden email]> wrote:
> >
> >> HI,
> >>
> >>
> >> On Fri, 29 Nov 2019 at 09:00, Kushagra Bindal <
> [hidden email]>
> >> wrote:
> >>
> >> > Hi,
> >> >
> >> > We are working on upgrading our enterprise application from 8.5.24 to
> >> > 9.0.27 version.
> >> >
> >> > What we have observed that in earlier version i.e. 8.5.24 we were able
> >> to
> >> > process process a REST URI have  double slash ("//") in it.
> >> >
> >> > But when we are upgrading it to 9.0.27 we found that now the same url
> >> which
> >> > was working earlier it is now throwing 404 status code.
> >> >
> >> > Now, the problem is that we can not remove these double slash (//)
> >> manually
> >> > as it is used widely.
> >> >
> >> > So, can someone please provide a possible solution of this issue?
> >> >
> >>
> >>  Tomcat processes HTTP query and URL using RFC 7230 standards. But
> >> multiple
> >> leading forward slash support was disabled by default for good reasons.
> >> This was done in 8.5.31 due to issues with Http Redirects involving
> >> Servlets.
> >>
> >> If you must use this, you have to modify your application context to add
> >> the override as true - the attribute is called
> >> "allowMultipleLeadingForwardSlashInPath".
> >>
> >> https://tomcat.apache.org/tomcat-8.5-doc/config/context.html
> >>
> >> But I would sincerely recommend that you work on such designs and
> correct
> >> them in your application. There is always a "way". This is one of the
> >> reasons web applications become obsolete requires huge maintenance.
> >>
> >> Thanks,
> >>
> >> >
> >> > --
> >> > Regards,
> >> > Kushagra Bindal
> >> > +91-9013792807
> >> >
> >>
> >
> >
> > --
> > Regards,
> > Kushagra Bindal
> > +91-9013792807
> >
>
>
> --
> Regards,
> Kushagra Bindal
> +91-9013792807
>
Reply | Threaded
Open this post in threaded view
|

Re: Double Slash Support in Tomcat 9.0.27

Kushagra Bindal
Hi Mark,

This astrik is because I highlighted it as BOLD. But I guess at your end it
is being received as plain text. Resending the content in context.xml

<Context allowMultipleLeadingForwardSlashInPath="true">

    <!-- Default set of monitored resources. If one of these changes, the
 -->
    <!-- web application will be reloaded.
  -->
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    <WatchedResource>WEB-INF/tomcat-web.xml</WatchedResource>
    <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>

    <ResourceLink name="jdbc/edbDataSource" global="jdbc/edbDataSource"
type="javax.sql.DataSource"/>

    <CookieProcessor
className="org.apache.tomcat.util.http.LegacyCookieProcessor" />

    <!-- Uncomment this to disable session persistence across Tomcat
restarts -->
    <!--
    <Manager pathname="" />
    -->

    <!-- Uncomment this to enable Comet connection tacking (provides events
         on session expiration as well as webapp lifecycle) -->
    <!--
    <Valve
className="org.apache.catalina.valves.CometConnectionManagerValve" />
    -->
</Context>



On Fri, Nov 29, 2019 at 5:52 PM M. Manna <[hidden email]> wrote:

> Hi
>
> On Fri, 29 Nov 2019 at 11:43, Kushagra Bindal <[hidden email]>
> wrote:
>
> > Hi Mark,
> >
> > We tried to put the changes as suggested by you. Below are the changes
> that
> > we have made in context.xml file.
> >
> > <Context *allowMultipleLeadingForwardSlashInPath="true"*>
>
>
> Why this asterisk? *
>
> >
> >
> >     <!-- Default set of monitored resources. If one of these changes, the
> >  -->
> >     <!-- web application will be reloaded.
> >   -->
> >     <WatchedResource>WEB-INF/web.xml</WatchedResource>
> >     <WatchedResource>WEB-INF/tomcat-web.xml</WatchedResource>
> >     <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
> >
> >     <ResourceLink name="jdbc/edbDataSource" global="jdbc/edbDataSource"
> > type="javax.sql.DataSource"/>
> >
> >     <CookieProcessor
> > className="org.apache.tomcat.util.http.LegacyCookieProcessor" />
> >
> >     <!-- Uncomment this to disable session persistence across Tomcat
> > restarts -->
> >     <!--
> >     <Manager pathname="" />
> >     -->
> >
> >     <!-- Uncomment this to enable Comet connection tacking (provides
> events
> >          on session expiration as well as webapp lifecycle) -->
> >     <!--
> >     <Valve
> > className="org.apache.catalina.valves.CometConnectionManagerValve" />
> >     -->
> > </Context>
> >
> > But after restart still I am getting below errors in tomcat's
> > *localhost_access_log.2019-11-29.txt* file.
> >
> > 172.18.0.3 - - [29/Nov/2019:11:27:45 +0000] "GET
> > /sdm/restcall/v1/platform//healthCheck HTTP/1.0" 404 -
> > 172.18.0.3 - - [29/Nov/2019:11:27:45 +0000] "GET
> > /sdm/restcall/v1/platform//healthCheck HTTP/1.0" 404 -
> > 172.18.0.3 - - [29/Nov/2019:11:27:46 +0000] "GET
> > /sdm/restcall/v1/platform//healthCheck HTTP/1.0" 404 -
> >
> > Please help me in correcting the syntax.
> >
> > Regards
> > Kushagra
> >
> > On Fri, Nov 29, 2019 at 4:02 PM Kushagra Bindal <
> [hidden email]
> > >
> > wrote:
> >
> > > Hi Mark,
> > >
> > > Thanks for providing the response.
> > >
> > > Yes, you are right that we should design our application to remove //
> > from
> > > being used.
> > >
> > > I will plan it accordingly, for the provided solution in below. Let me
> > try
> > > the same and I will revert back to you in case of any further queries
> and
> > > concerns.
> > >
> > > On Fri, Nov 29, 2019 at 2:56 PM M. Manna <[hidden email]> wrote:
> > >
> > >> HI,
> > >>
> > >>
> > >> On Fri, 29 Nov 2019 at 09:00, Kushagra Bindal <
> > [hidden email]>
> > >> wrote:
> > >>
> > >> > Hi,
> > >> >
> > >> > We are working on upgrading our enterprise application from 8.5.24
> to
> > >> > 9.0.27 version.
> > >> >
> > >> > What we have observed that in earlier version i.e. 8.5.24 we were
> able
> > >> to
> > >> > process process a REST URI have  double slash ("//") in it.
> > >> >
> > >> > But when we are upgrading it to 9.0.27 we found that now the same
> url
> > >> which
> > >> > was working earlier it is now throwing 404 status code.
> > >> >
> > >> > Now, the problem is that we can not remove these double slash (//)
> > >> manually
> > >> > as it is used widely.
> > >> >
> > >> > So, can someone please provide a possible solution of this issue?
> > >> >
> > >>
> > >>  Tomcat processes HTTP query and URL using RFC 7230 standards. But
> > >> multiple
> > >> leading forward slash support was disabled by default for good
> reasons.
> > >> This was done in 8.5.31 due to issues with Http Redirects involving
> > >> Servlets.
> > >>
> > >> If you must use this, you have to modify your application context to
> add
> > >> the override as true - the attribute is called
> > >> "allowMultipleLeadingForwardSlashInPath".
> > >>
> > >> https://tomcat.apache.org/tomcat-8.5-doc/config/context.html
> > >>
> > >> But I would sincerely recommend that you work on such designs and
> > correct
> > >> them in your application. There is always a "way". This is one of the
> > >> reasons web applications become obsolete requires huge maintenance.
> > >>
> > >> Thanks,
> > >>
> > >> >
> > >> > --
> > >> > Regards,
> > >> > Kushagra Bindal
> > >> > +91-9013792807
> > >> >
> > >>
> > >
> > >
> > > --
> > > Regards,
> > > Kushagra Bindal
> > > +91-9013792807
> > >
> >
> >
> > --
> > Regards,
> > Kushagra Bindal
> > +91-9013792807
> >
>


--
Regards,
Kushagra Bindal
+91-9013792807
Reply | Threaded
Open this post in threaded view
|

Re: Double Slash Support in Tomcat 9.0.27

M. Manna
Kushagra,

On Fri, 29 Nov 2019 at 12:29, Kushagra Bindal <[hidden email]>
wrote:

> Hi Mark,
>
> This astrik is because I highlighted it as BOLD. But I guess at your end it
> is being received as plain text. Resending the content in context.xml
>
> <Context allowMultipleLeadingForwardSlashInPath="true">
>
>     <!-- Default set of monitored resources. If one of these changes, the
>  -->
>     <!-- web application will be reloaded.
>   -->
>     <WatchedResource>WEB-INF/web.xml</WatchedResource>
>     <WatchedResource>WEB-INF/tomcat-web.xml</WatchedResource>
>     <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
>
>     <ResourceLink name="jdbc/edbDataSource" global="jdbc/edbDataSource"
> type="javax.sql.DataSource"/>
>
>     <CookieProcessor
> className="org.apache.tomcat.util.http.LegacyCookieProcessor" />
>
>     <!-- Uncomment this to disable session persistence across Tomcat
> restarts -->
>     <!--
>     <Manager pathname="" />
>     -->
>
>     <!-- Uncomment this to enable Comet connection tacking (provides events
>          on session expiration as well as webapp lifecycle) -->
>     <!--
>     <Valve
> className="org.apache.catalina.valves.CometConnectionManagerValve" />
>     -->
> </Context>
>
>
>
> On Fri, Nov 29, 2019 at 5:52 PM M. Manna <[hidden email]> wrote:
>
> > Hi
> >
> > On Fri, 29 Nov 2019 at 11:43, Kushagra Bindal <[hidden email]
> >
> > wrote:
> >
> > > Hi Mark,
> > >
> > > We tried to put the changes as suggested by you. Below are the changes
> > that
> > > we have made in context.xml file.
> > >
> > > <Context *allowMultipleLeadingForwardSlashInPath="true"*>
> >
> >
> > Why this asterisk? *
> >
> > >
> > >
> > >     <!-- Default set of monitored resources. If one of these changes,
> the
> > >  -->
> > >     <!-- web application will be reloaded.
> > >   -->
> > >     <WatchedResource>WEB-INF/web.xml</WatchedResource>
> > >     <WatchedResource>WEB-INF/tomcat-web.xml</WatchedResource>
> > >     <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
> > >
> > >     <ResourceLink name="jdbc/edbDataSource" global="jdbc/edbDataSource"
> > > type="javax.sql.DataSource"/>
> > >
> > >     <CookieProcessor
> > > className="org.apache.tomcat.util.http.LegacyCookieProcessor" />
> > >
> > >     <!-- Uncomment this to disable session persistence across Tomcat
> > > restarts -->
> > >     <!--
> > >     <Manager pathname="" />
> > >     -->
> > >
> > >     <!-- Uncomment this to enable Comet connection tacking (provides
> > events
> > >          on session expiration as well as webapp lifecycle) -->
> > >     <!--
> > >     <Valve
> > > className="org.apache.catalina.valves.CometConnectionManagerValve" />
> > >     -->
> > > </Context>
> > >
> > > But after restart still I am getting below errors in tomcat's
> > > *localhost_access_log.2019-11-29.txt* file.
> > >
> > > 172.18.0.3 - - [29/Nov/2019:11:27:45 +0000] "GET
> > > /sdm/restcall/v1/platform//healthCheck HTTP/1.0" 404 -
> > > 172.18.0.3 - - [29/Nov/2019:11:27:45 +0000] "GET
> > > /sdm/restcall/v1/platform//healthCheck HTTP/1.0" 404 -
> > > 172.18.0.3 - - [29/Nov/2019:11:27:46 +0000] "GET
> > > /sdm/restcall/v1/platform//healthCheck HTTP/1.0" 404 -
> > >
> > > Please help me in correcting the syntax.
> > >
> > > Regards
> > > Kushagra
> > >
> > > On Fri, Nov 29, 2019 at 4:02 PM Kushagra Bindal <
> > [hidden email]
> > > >
> > > wrote:
> > >
> > > > Hi Mark,
> > > >
> > > > Thanks for providing the response.
> > > >
> > > > Yes, you are right that we should design our application to remove //
> > > from
> > > > being used.
> > > >
> > > > I will plan it accordingly, for the provided solution in below. Let
> me
> > > try
> > > > the same and I will revert back to you in case of any further queries
> > and
> > > > concerns.
> > > >
> > > > On Fri, Nov 29, 2019 at 2:56 PM M. Manna <[hidden email]> wrote:
> > > >
> > > >> HI,
> > > >>
> > > >>
> > > >> On Fri, 29 Nov 2019 at 09:00, Kushagra Bindal <
> > > [hidden email]>
> > > >> wrote:
> > > >>
> > > >> > Hi,
> > > >> >
> > > >> > We are working on upgrading our enterprise application from 8.5.24
> > to
> > > >> > 9.0.27 version.
> > > >> >
> > > >> > What we have observed that in earlier version i.e. 8.5.24 we were
> > able
> > > >> to
> > > >> > process process a REST URI have  double slash ("//") in it.
> > > >> >
> > > >> > But when we are upgrading it to 9.0.27 we found that now the same
> > url
> > > >> which
> > > >> > was working earlier it is now throwing 404 status code.
> > > >> >
> > > >> > Now, the problem is that we can not remove these double slash (//)
> > > >> manually
> > > >> > as it is used widely.
> > > >> >
> > > >> > So, can someone please provide a possible solution of this issue?
> > > >> >
> > > >>
> > > >>  Tomcat processes HTTP query and URL using RFC 7230 standards. But
> > > >> multiple
> > > >> leading forward slash support was disabled by default for good
> > reasons.
> > > >> This was done in 8.5.31 due to issues with Http Redirects involving
> > > >> Servlets.
> > > >>
> > > >> If you must use this, you have to modify your application context to
> > add
> > > >> the override as true - the attribute is called
> > > >> "allowMultipleLeadingForwardSlashInPath".
> > > >>
> > > >> https://tomcat.apache.org/tomcat-8.5-doc/config/context.html
> > > >>
> > > >> But I would sincerely recommend that you work on such designs and
> > > correct
> > > >> them in your application. There is always a "way". This is one of
> the
> > > >> reasons web applications become obsolete requires huge maintenance.
> > > >>
> > > >> Thanks,
> > > >>
> > > >> >
> > > >> > --
> > > >> > Regards,
> > > >> > Kushagra Bindal
> > > >> > +91-9013792807
> > > >> >
> > > >>
> > > >
> > > >
> > > > --
> > > > Regards,
> > > > Kushagra Bindal
> > > > +91-9013792807
> > > >
> > >
> > >
> > > --
> > > Regards,
> > > Kushagra Bindal
> > > +91-9013792807
> > >
> >
>
>
I have just started a tomcat with
<Context allowMultipleLeadingForwardSlashInPath="true" >

in the context.xml file. works just fine. I am not Mark, but he did suggest
that your issue is probably handled better in filtering at Servlet request
level.

If you also provide the below (as Mark suggested earlier in his reply),
that will be great:


>
>
>
> *Can you provide more details such as:- an example request URI- the
> <url-pattern> for the servlet you expect it to match toThanks,Mark  *


Thanks,



> --
> Regards,
> Kushagra Bindal
> +91-9013792807
>
Reply | Threaded
Open this post in threaded view
|

Re: Double Slash Support in Tomcat 9.0.27

Kushagra Bindal
Hi Manna/Mark,

Below are the sample URL which we are passing to Tomcat.

http://backend_tomcat:8080//sdm/restcall)(.*)/file_uploads
http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck

As from the above example you can see that // location may vary case by
case.

So, you guys have a probable solution to handle such situation, then please
do let me know.

Looking forward to hearing from you.

Regards
Kushagra

On Fri, Nov 29, 2019 at 6:23 PM M. Manna <[hidden email]> wrote:

> Kushagra,
>
> On Fri, 29 Nov 2019 at 12:29, Kushagra Bindal <[hidden email]>
> wrote:
>
> > Hi Mark,
> >
> > This astrik is because I highlighted it as BOLD. But I guess at your end
> it
> > is being received as plain text. Resending the content in context.xml
> >
> > <Context allowMultipleLeadingForwardSlashInPath="true">
> >
> >     <!-- Default set of monitored resources. If one of these changes, the
> >  -->
> >     <!-- web application will be reloaded.
> >   -->
> >     <WatchedResource>WEB-INF/web.xml</WatchedResource>
> >     <WatchedResource>WEB-INF/tomcat-web.xml</WatchedResource>
> >     <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
> >
> >     <ResourceLink name="jdbc/edbDataSource" global="jdbc/edbDataSource"
> > type="javax.sql.DataSource"/>
> >
> >     <CookieProcessor
> > className="org.apache.tomcat.util.http.LegacyCookieProcessor" />
> >
> >     <!-- Uncomment this to disable session persistence across Tomcat
> > restarts -->
> >     <!--
> >     <Manager pathname="" />
> >     -->
> >
> >     <!-- Uncomment this to enable Comet connection tacking (provides
> events
> >          on session expiration as well as webapp lifecycle) -->
> >     <!--
> >     <Valve
> > className="org.apache.catalina.valves.CometConnectionManagerValve" />
> >     -->
> > </Context>
> >
> >
> >
> > On Fri, Nov 29, 2019 at 5:52 PM M. Manna <[hidden email]> wrote:
> >
> > > Hi
> > >
> > > On Fri, 29 Nov 2019 at 11:43, Kushagra Bindal <
> [hidden email]
> > >
> > > wrote:
> > >
> > > > Hi Mark,
> > > >
> > > > We tried to put the changes as suggested by you. Below are the
> changes
> > > that
> > > > we have made in context.xml file.
> > > >
> > > > <Context *allowMultipleLeadingForwardSlashInPath="true"*>
> > >
> > >
> > > Why this asterisk? *
> > >
> > > >
> > > >
> > > >     <!-- Default set of monitored resources. If one of these changes,
> > the
> > > >  -->
> > > >     <!-- web application will be reloaded.
> > > >   -->
> > > >     <WatchedResource>WEB-INF/web.xml</WatchedResource>
> > > >     <WatchedResource>WEB-INF/tomcat-web.xml</WatchedResource>
> > > >     <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
> > > >
> > > >     <ResourceLink name="jdbc/edbDataSource"
> global="jdbc/edbDataSource"
> > > > type="javax.sql.DataSource"/>
> > > >
> > > >     <CookieProcessor
> > > > className="org.apache.tomcat.util.http.LegacyCookieProcessor" />
> > > >
> > > >     <!-- Uncomment this to disable session persistence across Tomcat
> > > > restarts -->
> > > >     <!--
> > > >     <Manager pathname="" />
> > > >     -->
> > > >
> > > >     <!-- Uncomment this to enable Comet connection tacking (provides
> > > events
> > > >          on session expiration as well as webapp lifecycle) -->
> > > >     <!--
> > > >     <Valve
> > > > className="org.apache.catalina.valves.CometConnectionManagerValve" />
> > > >     -->
> > > > </Context>
> > > >
> > > > But after restart still I am getting below errors in tomcat's
> > > > *localhost_access_log.2019-11-29.txt* file.
> > > >
> > > > 172.18.0.3 - - [29/Nov/2019:11:27:45 +0000] "GET
> > > > /sdm/restcall/v1/platform//healthCheck HTTP/1.0" 404 -
> > > > 172.18.0.3 - - [29/Nov/2019:11:27:45 +0000] "GET
> > > > /sdm/restcall/v1/platform//healthCheck HTTP/1.0" 404 -
> > > > 172.18.0.3 - - [29/Nov/2019:11:27:46 +0000] "GET
> > > > /sdm/restcall/v1/platform//healthCheck HTTP/1.0" 404 -
> > > >
> > > > Please help me in correcting the syntax.
> > > >
> > > > Regards
> > > > Kushagra
> > > >
> > > > On Fri, Nov 29, 2019 at 4:02 PM Kushagra Bindal <
> > > [hidden email]
> > > > >
> > > > wrote:
> > > >
> > > > > Hi Mark,
> > > > >
> > > > > Thanks for providing the response.
> > > > >
> > > > > Yes, you are right that we should design our application to remove
> //
> > > > from
> > > > > being used.
> > > > >
> > > > > I will plan it accordingly, for the provided solution in below. Let
> > me
> > > > try
> > > > > the same and I will revert back to you in case of any further
> queries
> > > and
> > > > > concerns.
> > > > >
> > > > > On Fri, Nov 29, 2019 at 2:56 PM M. Manna <[hidden email]>
> wrote:
> > > > >
> > > > >> HI,
> > > > >>
> > > > >>
> > > > >> On Fri, 29 Nov 2019 at 09:00, Kushagra Bindal <
> > > > [hidden email]>
> > > > >> wrote:
> > > > >>
> > > > >> > Hi,
> > > > >> >
> > > > >> > We are working on upgrading our enterprise application from
> 8.5.24
> > > to
> > > > >> > 9.0.27 version.
> > > > >> >
> > > > >> > What we have observed that in earlier version i.e. 8.5.24 we
> were
> > > able
> > > > >> to
> > > > >> > process process a REST URI have  double slash ("//") in it.
> > > > >> >
> > > > >> > But when we are upgrading it to 9.0.27 we found that now the
> same
> > > url
> > > > >> which
> > > > >> > was working earlier it is now throwing 404 status code.
> > > > >> >
> > > > >> > Now, the problem is that we can not remove these double slash
> (//)
> > > > >> manually
> > > > >> > as it is used widely.
> > > > >> >
> > > > >> > So, can someone please provide a possible solution of this
> issue?
> > > > >> >
> > > > >>
> > > > >>  Tomcat processes HTTP query and URL using RFC 7230 standards. But
> > > > >> multiple
> > > > >> leading forward slash support was disabled by default for good
> > > reasons.
> > > > >> This was done in 8.5.31 due to issues with Http Redirects
> involving
> > > > >> Servlets.
> > > > >>
> > > > >> If you must use this, you have to modify your application context
> to
> > > add
> > > > >> the override as true - the attribute is called
> > > > >> "allowMultipleLeadingForwardSlashInPath".
> > > > >>
> > > > >> https://tomcat.apache.org/tomcat-8.5-doc/config/context.html
> > > > >>
> > > > >> But I would sincerely recommend that you work on such designs and
> > > > correct
> > > > >> them in your application. There is always a "way". This is one of
> > the
> > > > >> reasons web applications become obsolete requires huge
> maintenance.
> > > > >>
> > > > >> Thanks,
> > > > >>
> > > > >> >
> > > > >> > --
> > > > >> > Regards,
> > > > >> > Kushagra Bindal
> > > > >> > +91-9013792807
> > > > >> >
> > > > >>
> > > > >
> > > > >
> > > > > --
> > > > > Regards,
> > > > > Kushagra Bindal
> > > > > +91-9013792807
> > > > >
> > > >
> > > >
> > > > --
> > > > Regards,
> > > > Kushagra Bindal
> > > > +91-9013792807
> > > >
> > >
> >
> >
> I have just started a tomcat with
> <Context allowMultipleLeadingForwardSlashInPath="true" >
>
> in the context.xml file. works just fine. I am not Mark, but he did suggest
> that your issue is probably handled better in filtering at Servlet request
> level.
>
> If you also provide the below (as Mark suggested earlier in his reply),
> that will be great:
>
>
> >
> >
> >
> > *Can you provide more details such as:- an example request URI- the
> > <url-pattern> for the servlet you expect it to match toThanks,Mark  *
>
>
> Thanks,
>
>
>
> > --
> > Regards,
> > Kushagra Bindal
> > +91-9013792807
> >
>


--
Regards,
Kushagra Bindal
+91-9013792807
Reply | Threaded
Open this post in threaded view
|

Re: Double Slash Support in Tomcat 9.0.27

Mark Thomas-2
On 01/12/2019 07:11, Kushagra Bindal wrote:

> Hi Manna/Mark,
>
> Below are the sample URL which we are passing to Tomcat.
>
> http://backend_tomcat:8080//sdm/restcall)(.*)/file_uploads
> http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck
>
> As from the above example you can see that // location may vary case by
> case.
>
> So, you guys have a probable solution to handle such situation, then please
> do let me know.

Tomcat is simply going to normalize those to single '/'. The application
should be fine with that.

To repeat my previous request:
Can you provide more details such as:
- an example request URI
*and*
- the <url-pattern> for the servlet you expect it to match to

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Double Slash Support in Tomcat 9.0.27

Kushagra Bindal
Hi Mark,

Please find the snippet from web.xml

<servlet>
        <servlet-name>default</servlet-name>

<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
        <init-param>
            <param-name>debug</param-name>
            <param-value>0</param-value>
        </init-param>
        <init-param>
            <param-name>listings</param-name>
            <param-value>false</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
        <servlet-name>jsp</servlet-name>
        <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
        <init-param>
            <param-name>fork</param-name>
            <param-value>false</param-value>
        </init-param>
        <init-param>
            <param-name>xpoweredBy</param-name>
            <param-value>false</param-value>
        </init-param>
        <load-on-startup>3</load-on-startup>
    </servlet>
   <!-- The mapping for the default servlet -->
    <servlet-mapping>
        <servlet-name>default</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>
    <!-- The mappings for the JSP servlet -->
    <servlet-mapping>
        <servlet-name>jsp</servlet-name>
        <url-pattern>*.jsp</url-pattern>
        <url-pattern>*.jspx</url-pattern>
    </servlet-mapping>
     <servlet>
      <servlet-name>PatternTemplateLaunchServlet</servlet-name>
      <servlet-class>PatternTemplateLaunchServlet</servlet-class>
   </servlet>
   <servlet>
      <servlet-name>MyReportsLaunchServlet</servlet-name>
      <servlet-class>MyReportsLaunchServlet</servlet-class>
   </servlet>
   <servlet-mapping>
      <servlet-name>PatternTemplateLaunchServlet</servlet-name>
      <url-pattern>/patterntemplatelaunch</url-pattern>
   </servlet-mapping>
   <servlet-mapping>
      <servlet-name>MyReportsLaunchServlet</servlet-name>
      <url-pattern>/MyReportsLaunchServlet</url-pattern>
   </servlet-mapping>

Please let me know if you need anyother details from our side.

On Mon, Dec 2, 2019 at 3:07 AM Mark Thomas <[hidden email]> wrote:

> On 01/12/2019 07:11, Kushagra Bindal wrote:
> > Hi Manna/Mark,
> >
> > Below are the sample URL which we are passing to Tomcat.
> >
> > http://backend_tomcat:8080//sdm/restcall)(.*)/file_uploads
> > http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck
> >
> > As from the above example you can see that // location may vary case by
> > case.
> >
> > So, you guys have a probable solution to handle such situation, then
> please
> > do let me know.
>
> Tomcat is simply going to normalize those to single '/'. The application
> should be fine with that.
>
> To repeat my previous request:
> Can you provide more details such as:
> - an example request URI
> *and*
> - the <url-pattern> for the servlet you expect it to match to
>
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

--
Regards,
Kushagra Bindal
+91-9013792807
Reply | Threaded
Open this post in threaded view
|

Re: Double Slash Support in Tomcat 9.0.27

Mark Thomas-2
On 02/12/2019 04:53, Kushagra Bindal wrote:
> Hi Mark,
>
> Please find the snippet from web.xml

Which URL pattern do you expect:

"http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck"

to match?

And what is the Context Path at which the application is deployed?

Mark


>
> <servlet>
>         <servlet-name>default</servlet-name>
>
> <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
>         <init-param>
>             <param-name>debug</param-name>
>             <param-value>0</param-value>
>         </init-param>
>         <init-param>
>             <param-name>listings</param-name>
>             <param-value>false</param-value>
>         </init-param>
>         <load-on-startup>1</load-on-startup>
>     </servlet>
>     <servlet>
>         <servlet-name>jsp</servlet-name>
>         <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
>         <init-param>
>             <param-name>fork</param-name>
>             <param-value>false</param-value>
>         </init-param>
>         <init-param>
>             <param-name>xpoweredBy</param-name>
>             <param-value>false</param-value>
>         </init-param>
>         <load-on-startup>3</load-on-startup>
>     </servlet>
>    <!-- The mapping for the default servlet -->
>     <servlet-mapping>
>         <servlet-name>default</servlet-name>
>         <url-pattern>/</url-pattern>
>     </servlet-mapping>
>     <!-- The mappings for the JSP servlet -->
>     <servlet-mapping>
>         <servlet-name>jsp</servlet-name>
>         <url-pattern>*.jsp</url-pattern>
>         <url-pattern>*.jspx</url-pattern>
>     </servlet-mapping>
>      <servlet>
>       <servlet-name>PatternTemplateLaunchServlet</servlet-name>
>       <servlet-class>PatternTemplateLaunchServlet</servlet-class>
>    </servlet>
>    <servlet>
>       <servlet-name>MyReportsLaunchServlet</servlet-name>
>       <servlet-class>MyReportsLaunchServlet</servlet-class>
>    </servlet>
>    <servlet-mapping>
>       <servlet-name>PatternTemplateLaunchServlet</servlet-name>
>       <url-pattern>/patterntemplatelaunch</url-pattern>
>    </servlet-mapping>
>    <servlet-mapping>
>       <servlet-name>MyReportsLaunchServlet</servlet-name>
>       <url-pattern>/MyReportsLaunchServlet</url-pattern>
>    </servlet-mapping>
>
> Please let me know if you need anyother details from our side.
>
> On Mon, Dec 2, 2019 at 3:07 AM Mark Thomas <[hidden email]> wrote:
>
>> On 01/12/2019 07:11, Kushagra Bindal wrote:
>>> Hi Manna/Mark,
>>>
>>> Below are the sample URL which we are passing to Tomcat.
>>>
>>> http://backend_tomcat:8080//sdm/restcall)(.*)/file_uploads
>>> http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck
>>>
>>> As from the above example you can see that // location may vary case by
>>> case.
>>>
>>> So, you guys have a probable solution to handle such situation, then
>> please
>>> do let me know.
>>
>> Tomcat is simply going to normalize those to single '/'. The application
>> should be fine with that.
>>
>> To repeat my previous request:
>> Can you provide more details such as:
>> - an example request URI
>> *and*
>> - the <url-pattern> for the servlet you expect it to match to
>>
>> Mark
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Double Slash Support in Tomcat 9.0.27

Kushagra Bindal
Hi Mark,

These are Rest Endpoints, and so will be processed through Filter. Do, you
think Servlet mapping will play any role here?

On Mon, Dec 2, 2019 at 2:33 PM Mark Thomas <[hidden email]> wrote:

> On 02/12/2019 04:53, Kushagra Bindal wrote:
> > Hi Mark,
> >
> > Please find the snippet from web.xml
>
> Which URL pattern do you expect:
>
> "http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck"
>
> to match?
>
> And what is the Context Path at which the application is deployed?
>
> Mark
>
>
> >
> > <servlet>
> >         <servlet-name>default</servlet-name>
> >
> >
> <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
> >         <init-param>
> >             <param-name>debug</param-name>
> >             <param-value>0</param-value>
> >         </init-param>
> >         <init-param>
> >             <param-name>listings</param-name>
> >             <param-value>false</param-value>
> >         </init-param>
> >         <load-on-startup>1</load-on-startup>
> >     </servlet>
> >     <servlet>
> >         <servlet-name>jsp</servlet-name>
> >
>  <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
> >         <init-param>
> >             <param-name>fork</param-name>
> >             <param-value>false</param-value>
> >         </init-param>
> >         <init-param>
> >             <param-name>xpoweredBy</param-name>
> >             <param-value>false</param-value>
> >         </init-param>
> >         <load-on-startup>3</load-on-startup>
> >     </servlet>
> >    <!-- The mapping for the default servlet -->
> >     <servlet-mapping>
> >         <servlet-name>default</servlet-name>
> >         <url-pattern>/</url-pattern>
> >     </servlet-mapping>
> >     <!-- The mappings for the JSP servlet -->
> >     <servlet-mapping>
> >         <servlet-name>jsp</servlet-name>
> >         <url-pattern>*.jsp</url-pattern>
> >         <url-pattern>*.jspx</url-pattern>
> >     </servlet-mapping>
> >      <servlet>
> >       <servlet-name>PatternTemplateLaunchServlet</servlet-name>
> >       <servlet-class>PatternTemplateLaunchServlet</servlet-class>
> >    </servlet>
> >    <servlet>
> >       <servlet-name>MyReportsLaunchServlet</servlet-name>
> >       <servlet-class>MyReportsLaunchServlet</servlet-class>
> >    </servlet>
> >    <servlet-mapping>
> >       <servlet-name>PatternTemplateLaunchServlet</servlet-name>
> >       <url-pattern>/patterntemplatelaunch</url-pattern>
> >    </servlet-mapping>
> >    <servlet-mapping>
> >       <servlet-name>MyReportsLaunchServlet</servlet-name>
> >       <url-pattern>/MyReportsLaunchServlet</url-pattern>
> >    </servlet-mapping>
> >
> > Please let me know if you need anyother details from our side.
> >
> > On Mon, Dec 2, 2019 at 3:07 AM Mark Thomas <[hidden email]> wrote:
> >
> >> On 01/12/2019 07:11, Kushagra Bindal wrote:
> >>> Hi Manna/Mark,
> >>>
> >>> Below are the sample URL which we are passing to Tomcat.
> >>>
> >>> http://backend_tomcat:8080//sdm/restcall)(.*)/file_uploads
> >>> http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck
> >>>
> >>> As from the above example you can see that // location may vary case by
> >>> case.
> >>>
> >>> So, you guys have a probable solution to handle such situation, then
> >> please
> >>> do let me know.
> >>
> >> Tomcat is simply going to normalize those to single '/'. The application
> >> should be fine with that.
> >>
> >> To repeat my previous request:
> >> Can you provide more details such as:
> >> - an example request URI
> >> *and*
> >> - the <url-pattern> for the servlet you expect it to match to
> >>
> >> Mark
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [hidden email]
> >> For additional commands, e-mail: [hidden email]
> >>
> >>
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

--
Regards,
Kushagra Bindal
+91-9013792807
Reply | Threaded
Open this post in threaded view
|

Re: Double Slash Support in Tomcat 9.0.27

Kushagra Bindal
Hi Mark/Manna

Please let me know if I need to provide some additional information about
the deployments so that it can be helpful in resolving the issue.

Regards
Kushagra

On Mon, Dec 2, 2019, 4:29 PM Kushagra Bindal <[hidden email]>
wrote:

> Hi Mark,
>
> These are Rest Endpoints, and so will be processed through Filter. Do, you
> think Servlet mapping will play any role here?
>
> On Mon, Dec 2, 2019 at 2:33 PM Mark Thomas <[hidden email]> wrote:
>
>> On 02/12/2019 04:53, Kushagra Bindal wrote:
>> > Hi Mark,
>> >
>> > Please find the snippet from web.xml
>>
>> Which URL pattern do you expect:
>>
>> "http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck"
>>
>> to match?
>>
>> And what is the Context Path at which the application is deployed?
>>
>> Mark
>>
>>
>> >
>> > <servlet>
>> >         <servlet-name>default</servlet-name>
>> >
>> >
>> <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
>> >         <init-param>
>> >             <param-name>debug</param-name>
>> >             <param-value>0</param-value>
>> >         </init-param>
>> >         <init-param>
>> >             <param-name>listings</param-name>
>> >             <param-value>false</param-value>
>> >         </init-param>
>> >         <load-on-startup>1</load-on-startup>
>> >     </servlet>
>> >     <servlet>
>> >         <servlet-name>jsp</servlet-name>
>> >
>>  <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
>> >         <init-param>
>> >             <param-name>fork</param-name>
>> >             <param-value>false</param-value>
>> >         </init-param>
>> >         <init-param>
>> >             <param-name>xpoweredBy</param-name>
>> >             <param-value>false</param-value>
>> >         </init-param>
>> >         <load-on-startup>3</load-on-startup>
>> >     </servlet>
>> >    <!-- The mapping for the default servlet -->
>> >     <servlet-mapping>
>> >         <servlet-name>default</servlet-name>
>> >         <url-pattern>/</url-pattern>
>> >     </servlet-mapping>
>> >     <!-- The mappings for the JSP servlet -->
>> >     <servlet-mapping>
>> >         <servlet-name>jsp</servlet-name>
>> >         <url-pattern>*.jsp</url-pattern>
>> >         <url-pattern>*.jspx</url-pattern>
>> >     </servlet-mapping>
>> >      <servlet>
>> >       <servlet-name>PatternTemplateLaunchServlet</servlet-name>
>> >       <servlet-class>PatternTemplateLaunchServlet</servlet-class>
>> >    </servlet>
>> >    <servlet>
>> >       <servlet-name>MyReportsLaunchServlet</servlet-name>
>> >       <servlet-class>MyReportsLaunchServlet</servlet-class>
>> >    </servlet>
>> >    <servlet-mapping>
>> >       <servlet-name>PatternTemplateLaunchServlet</servlet-name>
>> >       <url-pattern>/patterntemplatelaunch</url-pattern>
>> >    </servlet-mapping>
>> >    <servlet-mapping>
>> >       <servlet-name>MyReportsLaunchServlet</servlet-name>
>> >       <url-pattern>/MyReportsLaunchServlet</url-pattern>
>> >    </servlet-mapping>
>> >
>> > Please let me know if you need anyother details from our side.
>> >
>> > On Mon, Dec 2, 2019 at 3:07 AM Mark Thomas <[hidden email]> wrote:
>> >
>> >> On 01/12/2019 07:11, Kushagra Bindal wrote:
>> >>> Hi Manna/Mark,
>> >>>
>> >>> Below are the sample URL which we are passing to Tomcat.
>> >>>
>> >>> http://backend_tomcat:8080//sdm/restcall)(.*)/file_uploads
>> >>> http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck
>> >>>
>> >>> As from the above example you can see that // location may vary case
>> by
>> >>> case.
>> >>>
>> >>> So, you guys have a probable solution to handle such situation, then
>> >> please
>> >>> do let me know.
>> >>
>> >> Tomcat is simply going to normalize those to single '/'. The
>> application
>> >> should be fine with that.
>> >>
>> >> To repeat my previous request:
>> >> Can you provide more details such as:
>> >> - an example request URI
>> >> *and*
>> >> - the <url-pattern> for the servlet you expect it to match to
>> >>
>> >> Mark
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: [hidden email]
>> >> For additional commands, e-mail: [hidden email]
>> >>
>> >>
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
> --
> Regards,
> Kushagra Bindal
> +91-9013792807
>
Reply | Threaded
Open this post in threaded view
|

Re: Double Slash Support in Tomcat 9.0.27

Mark Thomas-2
In reply to this post by Kushagra Bindal
On 02/12/2019 10:59, Kushagra Bindal wrote:
> Hi Mark,
>
> These are Rest Endpoints, and so will be processed through Filter.

That is unusual.

> Do, you
> think Servlet mapping will play any role here?

If the filter is handling them, no.

So I'll change the question. Which URL pattern from the filter mapping
do you expect:

"http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck"

to match?

The Context Path question still needs an answer.

Mark


>
> On Mon, Dec 2, 2019 at 2:33 PM Mark Thomas <[hidden email]> wrote:
>
>> On 02/12/2019 04:53, Kushagra Bindal wrote:
>>> Hi Mark,
>>>
>>> Please find the snippet from web.xml
>>
>> Which URL pattern do you expect:
>>
>> "http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck"
>>
>> to match?
>>
>> And what is the Context Path at which the application is deployed?
>>
>> Mark
>>
>>
>>>
>>> <servlet>
>>>         <servlet-name>default</servlet-name>
>>>
>>>
>> <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
>>>         <init-param>
>>>             <param-name>debug</param-name>
>>>             <param-value>0</param-value>
>>>         </init-param>
>>>         <init-param>
>>>             <param-name>listings</param-name>
>>>             <param-value>false</param-value>
>>>         </init-param>
>>>         <load-on-startup>1</load-on-startup>
>>>     </servlet>
>>>     <servlet>
>>>         <servlet-name>jsp</servlet-name>
>>>
>>  <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
>>>         <init-param>
>>>             <param-name>fork</param-name>
>>>             <param-value>false</param-value>
>>>         </init-param>
>>>         <init-param>
>>>             <param-name>xpoweredBy</param-name>
>>>             <param-value>false</param-value>
>>>         </init-param>
>>>         <load-on-startup>3</load-on-startup>
>>>     </servlet>
>>>    <!-- The mapping for the default servlet -->
>>>     <servlet-mapping>
>>>         <servlet-name>default</servlet-name>
>>>         <url-pattern>/</url-pattern>
>>>     </servlet-mapping>
>>>     <!-- The mappings for the JSP servlet -->
>>>     <servlet-mapping>
>>>         <servlet-name>jsp</servlet-name>
>>>         <url-pattern>*.jsp</url-pattern>
>>>         <url-pattern>*.jspx</url-pattern>
>>>     </servlet-mapping>
>>>      <servlet>
>>>       <servlet-name>PatternTemplateLaunchServlet</servlet-name>
>>>       <servlet-class>PatternTemplateLaunchServlet</servlet-class>
>>>    </servlet>
>>>    <servlet>
>>>       <servlet-name>MyReportsLaunchServlet</servlet-name>
>>>       <servlet-class>MyReportsLaunchServlet</servlet-class>
>>>    </servlet>
>>>    <servlet-mapping>
>>>       <servlet-name>PatternTemplateLaunchServlet</servlet-name>
>>>       <url-pattern>/patterntemplatelaunch</url-pattern>
>>>    </servlet-mapping>
>>>    <servlet-mapping>
>>>       <servlet-name>MyReportsLaunchServlet</servlet-name>
>>>       <url-pattern>/MyReportsLaunchServlet</url-pattern>
>>>    </servlet-mapping>
>>>
>>> Please let me know if you need anyother details from our side.
>>>
>>> On Mon, Dec 2, 2019 at 3:07 AM Mark Thomas <[hidden email]> wrote:
>>>
>>>> On 01/12/2019 07:11, Kushagra Bindal wrote:
>>>>> Hi Manna/Mark,
>>>>>
>>>>> Below are the sample URL which we are passing to Tomcat.
>>>>>
>>>>> http://backend_tomcat:8080//sdm/restcall)(.*)/file_uploads
>>>>> http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck
>>>>>
>>>>> As from the above example you can see that // location may vary case by
>>>>> case.
>>>>>
>>>>> So, you guys have a probable solution to handle such situation, then
>>>> please
>>>>> do let me know.
>>>>
>>>> Tomcat is simply going to normalize those to single '/'. The application
>>>> should be fine with that.
>>>>
>>>> To repeat my previous request:
>>>> Can you provide more details such as:
>>>> - an example request URI
>>>> *and*
>>>> - the <url-pattern> for the servlet you expect it to match to
>>>>
>>>> Mark
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Double Slash Support in Tomcat 9.0.27

Kushagra Bindal
I think it should be.

<filter>
      <description>DanglingSessionInvalidateFilter</description>
      <filter-name>DanglingSessionInvalidateFilter</filter-name>
      <filter-class>com.SessionInvalidateFilter</filter-class>
   </filter>
<filter-mapping>
      <filter-name>DanglingSessionInvalidateFilter</filter-name>
      <url-pattern>/restcall/*</url-pattern>
   </filter-mapping>

Here in below URL:

"http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck"

sdm will be the context path.

But in another example that I shared in my last email, one use case
http://backend_tomcat:8080//sdm/restcall)(.*)/file_uploads my context path
itself contains //.

So, please suggest a viable solution which we can try to solve this
problem. :)

Thanks in advance for your help & support in resolving this issue.

Regards
Kushagra

On Mon, Dec 2, 2019 at 9:00 PM Mark Thomas <[hidden email]> wrote:

> On 02/12/2019 10:59, Kushagra Bindal wrote:
> > Hi Mark,
> >
> > These are Rest Endpoints, and so will be processed through Filter.
>
> That is unusual.
>
> > Do, you
> > think Servlet mapping will play any role here?
>
> If the filter is handling them, no.
>
> So I'll change the question. Which URL pattern from the filter mapping
> do you expect:
>
> "http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck"
>
> to match?
>
> The Context Path question still needs an answer.
>
> Mark
>
>
> >
> > On Mon, Dec 2, 2019 at 2:33 PM Mark Thomas <[hidden email]> wrote:
> >
> >> On 02/12/2019 04:53, Kushagra Bindal wrote:
> >>> Hi Mark,
> >>>
> >>> Please find the snippet from web.xml
> >>
> >> Which URL pattern do you expect:
> >>
> >> "http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck"
> >>
> >> to match?
> >>
> >> And what is the Context Path at which the application is deployed?
> >>
> >> Mark
> >>
> >>
> >>>
> >>> <servlet>
> >>>         <servlet-name>default</servlet-name>
> >>>
> >>>
> >>
> <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
> >>>         <init-param>
> >>>             <param-name>debug</param-name>
> >>>             <param-value>0</param-value>
> >>>         </init-param>
> >>>         <init-param>
> >>>             <param-name>listings</param-name>
> >>>             <param-value>false</param-value>
> >>>         </init-param>
> >>>         <load-on-startup>1</load-on-startup>
> >>>     </servlet>
> >>>     <servlet>
> >>>         <servlet-name>jsp</servlet-name>
> >>>
> >>  <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
> >>>         <init-param>
> >>>             <param-name>fork</param-name>
> >>>             <param-value>false</param-value>
> >>>         </init-param>
> >>>         <init-param>
> >>>             <param-name>xpoweredBy</param-name>
> >>>             <param-value>false</param-value>
> >>>         </init-param>
> >>>         <load-on-startup>3</load-on-startup>
> >>>     </servlet>
> >>>    <!-- The mapping for the default servlet -->
> >>>     <servlet-mapping>
> >>>         <servlet-name>default</servlet-name>
> >>>         <url-pattern>/</url-pattern>
> >>>     </servlet-mapping>
> >>>     <!-- The mappings for the JSP servlet -->
> >>>     <servlet-mapping>
> >>>         <servlet-name>jsp</servlet-name>
> >>>         <url-pattern>*.jsp</url-pattern>
> >>>         <url-pattern>*.jspx</url-pattern>
> >>>     </servlet-mapping>
> >>>      <servlet>
> >>>       <servlet-name>PatternTemplateLaunchServlet</servlet-name>
> >>>       <servlet-class>PatternTemplateLaunchServlet</servlet-class>
> >>>    </servlet>
> >>>    <servlet>
> >>>       <servlet-name>MyReportsLaunchServlet</servlet-name>
> >>>       <servlet-class>MyReportsLaunchServlet</servlet-class>
> >>>    </servlet>
> >>>    <servlet-mapping>
> >>>       <servlet-name>PatternTemplateLaunchServlet</servlet-name>
> >>>       <url-pattern>/patterntemplatelaunch</url-pattern>
> >>>    </servlet-mapping>
> >>>    <servlet-mapping>
> >>>       <servlet-name>MyReportsLaunchServlet</servlet-name>
> >>>       <url-pattern>/MyReportsLaunchServlet</url-pattern>
> >>>    </servlet-mapping>
> >>>
> >>> Please let me know if you need anyother details from our side.
> >>>
> >>> On Mon, Dec 2, 2019 at 3:07 AM Mark Thomas <[hidden email]> wrote:
> >>>
> >>>> On 01/12/2019 07:11, Kushagra Bindal wrote:
> >>>>> Hi Manna/Mark,
> >>>>>
> >>>>> Below are the sample URL which we are passing to Tomcat.
> >>>>>
> >>>>> http://backend_tomcat:8080//sdm/restcall)(.*)/file_uploads
> >>>>> http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck
> >>>>>
> >>>>> As from the above example you can see that // location may vary case
> by
> >>>>> case.
> >>>>>
> >>>>> So, you guys have a probable solution to handle such situation, then
> >>>> please
> >>>>> do let me know.
> >>>>
> >>>> Tomcat is simply going to normalize those to single '/'. The
> application
> >>>> should be fine with that.
> >>>>
> >>>> To repeat my previous request:
> >>>> Can you provide more details such as:
> >>>> - an example request URI
> >>>> *and*
> >>>> - the <url-pattern> for the servlet you expect it to match to
> >>>>
> >>>> Mark
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: [hidden email]
> >>>> For additional commands, e-mail: [hidden email]
> >>>>
> >>>>
> >>>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [hidden email]
> >> For additional commands, e-mail: [hidden email]
> >>
> >>
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

--
Regards,
Kushagra Bindal
+91-9013792807
Reply | Threaded
Open this post in threaded view
|

Re: Double Slash Support in Tomcat 9.0.27

Christopher Schultz-2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Kushagra,

On 12/2/19 11:29, Kushagra Bindal wrote:

> I think it should be.
>
> <filter>
> <description>DanglingSessionInvalidateFilter</description>
> <filter-name>DanglingSessionInvalidateFilter</filter-name>
> <filter-class>com.SessionInvalidateFilter</filter-class> </filter>
> <filter-mapping>
> <filter-name>DanglingSessionInvalidateFilter</filter-name>
> <url-pattern>/restcall/*</url-pattern> </filter-mapping>
>
> Here in below URL:
>
> "http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck"
>
> sdm will be the context path.
>
> But in another example that I shared in my last email, one use
> case http://backend_tomcat:8080//sdm/restcall)(.*)/file_uploads my
> context path itself contains //.
>
> So, please suggest a viable solution which we can try to solve
> this problem. :)
>
> Thanks in advance for your help & support in resolving this issue.

All of these slashes really should be collapsed into a single slash
before processing. I don't see an issue. If the client requests:

   http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck

then the filter/servlet at /sdm/restcall/* will respond.

If the client requests:

   http://backend_tomcat:8080//sdm/restcall/foo/file_uploads

Then the filter/servlet at /sdm/restcall/* will respond.

It doesn't really matter how many extra slashes the client adds...
they should all be collapsed by the server and your application should
not have to make arrangements to handle them, add them back, or worry
about whether they are there or not.

- -chris

> On Mon, Dec 2, 2019 at 9:00 PM Mark Thomas <[hidden email]>
> wrote:
>
>> On 02/12/2019 10:59, Kushagra Bindal wrote:
>>> Hi Mark,
>>>
>>> These are Rest Endpoints, and so will be processed through
>>> Filter.
>>
>> That is unusual.
>>
>>> Do, you think Servlet mapping will play any role here?
>>
>> If the filter is handling them, no.
>>
>> So I'll change the question. Which URL pattern from the filter
>> mapping do you expect:
>>
>> "http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck"
>>
>>
>>
to match?

>>
>> The Context Path question still needs an answer.
>>
>> Mark
>>
>>
>>>
>>> On Mon, Dec 2, 2019 at 2:33 PM Mark Thomas <[hidden email]>
>>> wrote:
>>>
>>>> On 02/12/2019 04:53, Kushagra Bindal wrote:
>>>>> Hi Mark,
>>>>>
>>>>> Please find the snippet from web.xml
>>>>
>>>> Which URL pattern do you expect:
>>>>
>>>> "http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck"
>>>>
>>>>
>>>>
to match?

>>>>
>>>> And what is the Context Path at which the application is
>>>> deployed?
>>>>
>>>> Mark
>>>>
>>>>
>>>>>
>>>>> <servlet> <servlet-name>default</servlet-name>
>>>>>
>>>>>
>>>>
>> <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-c
lass>
>>>>>
>>
<init-param>

>>>>> <param-name>debug</param-name>
>>>>> <param-value>0</param-value> </init-param> <init-param>
>>>>> <param-name>listings</param-name>
>>>>> <param-value>false</param-value> </init-param>
>>>>> <load-on-startup>1</load-on-startup> </servlet> <servlet>
>>>>> <servlet-name>jsp</servlet-name>
>>>>>
>>>> <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
>>>>>
>>>>
<init-param>

>>>>> <param-name>fork</param-name>
>>>>> <param-value>false</param-value> </init-param>
>>>>> <init-param> <param-name>xpoweredBy</param-name>
>>>>> <param-value>false</param-value> </init-param>
>>>>> <load-on-startup>3</load-on-startup> </servlet> <!-- The
>>>>> mapping for the default servlet --> <servlet-mapping>
>>>>> <servlet-name>default</servlet-name>
>>>>> <url-pattern>/</url-pattern> </servlet-mapping> <!-- The
>>>>> mappings for the JSP servlet --> <servlet-mapping>
>>>>> <servlet-name>jsp</servlet-name>
>>>>> <url-pattern>*.jsp</url-pattern>
>>>>> <url-pattern>*.jspx</url-pattern> </servlet-mapping>
>>>>> <servlet>
>>>>> <servlet-name>PatternTemplateLaunchServlet</servlet-name>
>>>>> <servlet-class>PatternTemplateLaunchServlet</servlet-class>
>>>>>
>>>>>
</servlet>

>>>>> <servlet>
>>>>> <servlet-name>MyReportsLaunchServlet</servlet-name>
>>>>> <servlet-class>MyReportsLaunchServlet</servlet-class>
>>>>> </servlet> <servlet-mapping>
>>>>> <servlet-name>PatternTemplateLaunchServlet</servlet-name>
>>>>> <url-pattern>/patterntemplatelaunch</url-pattern>
>>>>> </servlet-mapping> <servlet-mapping>
>>>>> <servlet-name>MyReportsLaunchServlet</servlet-name>
>>>>> <url-pattern>/MyReportsLaunchServlet</url-pattern>
>>>>> </servlet-mapping>
>>>>>
>>>>> Please let me know if you need anyother details from our
>>>>> side.
>>>>>
>>>>> On Mon, Dec 2, 2019 at 3:07 AM Mark Thomas
>>>>> <[hidden email]> wrote:
>>>>>
>>>>>> On 01/12/2019 07:11, Kushagra Bindal wrote:
>>>>>>> Hi Manna/Mark,
>>>>>>>
>>>>>>> Below are the sample URL which we are passing to
>>>>>>> Tomcat.
>>>>>>>
>>>>>>> http://backend_tomcat:8080//sdm/restcall)(.*)/file_uploads
>>>>>>>
>>>>>>>
http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck

>>>>>>>
>>>>>>> As from the above example you can see that // location
>>>>>>> may vary case
>> by
>>>>>>> case.
>>>>>>>
>>>>>>> So, you guys have a probable solution to handle such
>>>>>>> situation, then
>>>>>> please
>>>>>>> do let me know.
>>>>>>
>>>>>> Tomcat is simply going to normalize those to single '/'.
>>>>>> The
>> application
>>>>>> should be fine with that.
>>>>>>
>>>>>> To repeat my previous request: Can you provide more
>>>>>> details such as: - an example request URI *and* - the
>>>>>> <url-pattern> for the servlet you expect it to match to
>>>>>>
>>>>>> Mark
>>>>>>
>>>>>> -----------------------------------------------------------------
- ----
>>>>>>
>>>>>>
To unsubscribe, e-mail: [hidden email]
>>>>>> For additional commands, e-mail:
>>>>>> [hidden email]
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>> -------------------------------------------------------------------
- --
>>>>
>>>>
To unsubscribe, e-mail: [hidden email]

>>>> For additional commands, e-mail:
>>>> [hidden email]
>>>>
>>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>>
>>
To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl3lazUACgkQHPApP6U8
pFj62hAAsXJM1uwsodox5AeVs6UCs1/uuUxHatmnd4LpKJzoHq8u2OEBNkUHEY/8
46dJ/RtGBRcsgqA/sopbYjELtKUAwQPPKDEiD5DlpCg2ksyE75bTPb49PcO5a880
b2dyYAsfxpccApUXsTGasXriR0Mis/W7E1rqUy6TY7qo/PXVWR5bLFxc540+iEjf
Zuwi0l4cg43d2R8NABbsN7HQWu7rDBFJkeXWpVc5QXy/XdAkIgkgsBux1QaOcZgG
yf9saKknAwBqgMzPRvMEh6h4Lio/LRd1ido1M52X7Hqeuw7Kj9zzcnCF85LRZ73n
hkHUrMVvi++AELLzr+WhFSduJxrdtAfnRlXu7zYt6CfzxETu+t3g5c83/fF5QzDZ
nwdAKRmSPEMmVM8eczCrsYbFpITJjR71pRopFIKmJhrran6hFAn5vIUE5ay9QEv+
JUQqf9lrL5gQYUdaNqsAMe+JqYeiNLy8x/8y5qrUk/Jb2FtDx6yoJAUi9mFO/mCC
BsmnjEOE1TB9rylCzcSmHzJP6rYnd6pqoyCiq4NNAeaQBysIHKUwMWqMEEPrszED
P6MwKUUdzRuzX+SrLeRaIzqByRUzYtOuMP5IMPCB8tP2VE8R0J2txYyH2TMlBZgy
ZbcS3VB+kyz2RlX34bIN8gJZz7RQiSlATao0ux9A96KTbqMSIQs=
=c9w2
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Double Slash Support in Tomcat 9.0.27

Kushagra Bindal
Chris,

If you will check in my early email then you will find that with // it is
throwing 404. But as soon as I removed it manually then it starts working
properly and all these url were working fine in 8.5.24 version.

On Tue, Dec 3, 2019, 1:21 AM Christopher Schultz <
[hidden email]> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Kushagra,
>
> On 12/2/19 11:29, Kushagra Bindal wrote:
> > I think it should be.
> >
> > <filter>
> > <description>DanglingSessionInvalidateFilter</description>
> > <filter-name>DanglingSessionInvalidateFilter</filter-name>
> > <filter-class>com.SessionInvalidateFilter</filter-class> </filter>
> > <filter-mapping>
> > <filter-name>DanglingSessionInvalidateFilter</filter-name>
> > <url-pattern>/restcall/*</url-pattern> </filter-mapping>
> >
> > Here in below URL:
> >
> > "http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck"
> >
> > sdm will be the context path.
> >
> > But in another example that I shared in my last email, one use
> > case http://backend_tomcat:8080//sdm/restcall)(.*)/file_uploads my
> > context path itself contains //.
> >
> > So, please suggest a viable solution which we can try to solve
> > this problem. :)
> >
> > Thanks in advance for your help & support in resolving this issue.
>
> All of these slashes really should be collapsed into a single slash
> before processing. I don't see an issue. If the client requests:
>
>    http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck
>
> then the filter/servlet at /sdm/restcall/* will respond.
>
> If the client requests:
>
>    http://backend_tomcat:8080//sdm/restcall/foo/file_uploads
>
> Then the filter/servlet at /sdm/restcall/* will respond.
>
> It doesn't really matter how many extra slashes the client adds...
> they should all be collapsed by the server and your application should
> not have to make arrangements to handle them, add them back, or worry
> about whether they are there or not.
>
> - -chris
>
> > On Mon, Dec 2, 2019 at 9:00 PM Mark Thomas <[hidden email]>
> > wrote:
> >
> >> On 02/12/2019 10:59, Kushagra Bindal wrote:
> >>> Hi Mark,
> >>>
> >>> These are Rest Endpoints, and so will be processed through
> >>> Filter.
> >>
> >> That is unusual.
> >>
> >>> Do, you think Servlet mapping will play any role here?
> >>
> >> If the filter is handling them, no.
> >>
> >> So I'll change the question. Which URL pattern from the filter
> >> mapping do you expect:
> >>
> >> "http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck"
> >>
> >>
> >>
> to match?
> >>
> >> The Context Path question still needs an answer.
> >>
> >> Mark
> >>
> >>
> >>>
> >>> On Mon, Dec 2, 2019 at 2:33 PM Mark Thomas <[hidden email]>
> >>> wrote:
> >>>
> >>>> On 02/12/2019 04:53, Kushagra Bindal wrote:
> >>>>> Hi Mark,
> >>>>>
> >>>>> Please find the snippet from web.xml
> >>>>
> >>>> Which URL pattern do you expect:
> >>>>
> >>>> "http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck"
> >>>>
> >>>>
> >>>>
> to match?
> >>>>
> >>>> And what is the Context Path at which the application is
> >>>> deployed?
> >>>>
> >>>> Mark
> >>>>
> >>>>
> >>>>>
> >>>>> <servlet> <servlet-name>default</servlet-name>
> >>>>>
> >>>>>
> >>>>
> >> <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-c
> lass>
> >>>>>
> >>
> <init-param>
> >>>>> <param-name>debug</param-name>
> >>>>> <param-value>0</param-value> </init-param> <init-param>
> >>>>> <param-name>listings</param-name>
> >>>>> <param-value>false</param-value> </init-param>
> >>>>> <load-on-startup>1</load-on-startup> </servlet> <servlet>
> >>>>> <servlet-name>jsp</servlet-name>
> >>>>>
> >>>> <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
> >>>>>
> >>>>
> <init-param>
> >>>>> <param-name>fork</param-name>
> >>>>> <param-value>false</param-value> </init-param>
> >>>>> <init-param> <param-name>xpoweredBy</param-name>
> >>>>> <param-value>false</param-value> </init-param>
> >>>>> <load-on-startup>3</load-on-startup> </servlet> <!-- The
> >>>>> mapping for the default servlet --> <servlet-mapping>
> >>>>> <servlet-name>default</servlet-name>
> >>>>> <url-pattern>/</url-pattern> </servlet-mapping> <!-- The
> >>>>> mappings for the JSP servlet --> <servlet-mapping>
> >>>>> <servlet-name>jsp</servlet-name>
> >>>>> <url-pattern>*.jsp</url-pattern>
> >>>>> <url-pattern>*.jspx</url-pattern> </servlet-mapping>
> >>>>> <servlet>
> >>>>> <servlet-name>PatternTemplateLaunchServlet</servlet-name>
> >>>>> <servlet-class>PatternTemplateLaunchServlet</servlet-class>
> >>>>>
> >>>>>
> </servlet>
> >>>>> <servlet>
> >>>>> <servlet-name>MyReportsLaunchServlet</servlet-name>
> >>>>> <servlet-class>MyReportsLaunchServlet</servlet-class>
> >>>>> </servlet> <servlet-mapping>
> >>>>> <servlet-name>PatternTemplateLaunchServlet</servlet-name>
> >>>>> <url-pattern>/patterntemplatelaunch</url-pattern>
> >>>>> </servlet-mapping> <servlet-mapping>
> >>>>> <servlet-name>MyReportsLaunchServlet</servlet-name>
> >>>>> <url-pattern>/MyReportsLaunchServlet</url-pattern>
> >>>>> </servlet-mapping>
> >>>>>
> >>>>> Please let me know if you need anyother details from our
> >>>>> side.
> >>>>>
> >>>>> On Mon, Dec 2, 2019 at 3:07 AM Mark Thomas
> >>>>> <[hidden email]> wrote:
> >>>>>
> >>>>>> On 01/12/2019 07:11, Kushagra Bindal wrote:
> >>>>>>> Hi Manna/Mark,
> >>>>>>>
> >>>>>>> Below are the sample URL which we are passing to
> >>>>>>> Tomcat.
> >>>>>>>
> >>>>>>> http://backend_tomcat:8080//sdm/restcall)(.*)/file_uploads
> >>>>>>>
> >>>>>>>
> http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck
> >>>>>>>
> >>>>>>> As from the above example you can see that // location
> >>>>>>> may vary case
> >> by
> >>>>>>> case.
> >>>>>>>
> >>>>>>> So, you guys have a probable solution to handle such
> >>>>>>> situation, then
> >>>>>> please
> >>>>>>> do let me know.
> >>>>>>
> >>>>>> Tomcat is simply going to normalize those to single '/'.
> >>>>>> The
> >> application
> >>>>>> should be fine with that.
> >>>>>>
> >>>>>> To repeat my previous request: Can you provide more
> >>>>>> details such as: - an example request URI *and* - the
> >>>>>> <url-pattern> for the servlet you expect it to match to
> >>>>>>
> >>>>>> Mark
> >>>>>>
> >>>>>> -----------------------------------------------------------------
> - ----
> >>>>>>
> >>>>>>
> To unsubscribe, e-mail: [hidden email]
> >>>>>> For additional commands, e-mail:
> >>>>>> [hidden email]
> >>>>>>
> >>>>>>
> >>>>>
> >>>>
> >>>>
> >>>> -------------------------------------------------------------------
> - --
> >>>>
> >>>>
> To unsubscribe, e-mail: [hidden email]
> >>>> For additional commands, e-mail:
> >>>> [hidden email]
> >>>>
> >>>>
> >>>
> >>
> >>
> >> ---------------------------------------------------------------------
> >>
> >>
> To unsubscribe, e-mail: [hidden email]
> >> For additional commands, e-mail: [hidden email]
> >>
> >>
> >
> -----BEGIN PGP SIGNATURE-----
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl3lazUACgkQHPApP6U8
> pFj62hAAsXJM1uwsodox5AeVs6UCs1/uuUxHatmnd4LpKJzoHq8u2OEBNkUHEY/8
> 46dJ/RtGBRcsgqA/sopbYjELtKUAwQPPKDEiD5DlpCg2ksyE75bTPb49PcO5a880
> b2dyYAsfxpccApUXsTGasXriR0Mis/W7E1rqUy6TY7qo/PXVWR5bLFxc540+iEjf
> Zuwi0l4cg43d2R8NABbsN7HQWu7rDBFJkeXWpVc5QXy/XdAkIgkgsBux1QaOcZgG
> yf9saKknAwBqgMzPRvMEh6h4Lio/LRd1ido1M52X7Hqeuw7Kj9zzcnCF85LRZ73n
> hkHUrMVvi++AELLzr+WhFSduJxrdtAfnRlXu7zYt6CfzxETu+t3g5c83/fF5QzDZ
> nwdAKRmSPEMmVM8eczCrsYbFpITJjR71pRopFIKmJhrran6hFAn5vIUE5ay9QEv+
> JUQqf9lrL5gQYUdaNqsAMe+JqYeiNLy8x/8y5qrUk/Jb2FtDx6yoJAUi9mFO/mCC
> BsmnjEOE1TB9rylCzcSmHzJP6rYnd6pqoyCiq4NNAeaQBysIHKUwMWqMEEPrszED
> P6MwKUUdzRuzX+SrLeRaIzqByRUzYtOuMP5IMPCB8tP2VE8R0J2txYyH2TMlBZgy
> ZbcS3VB+kyz2RlX34bIN8gJZz7RQiSlATao0ux9A96KTbqMSIQs=
> =c9w2
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Double Slash Support in Tomcat 9.0.27

Kushagra Bindal
Hi Mark/Manna/Chris,

Do we have any way out to handle this type of behavior?

On Tue, Dec 3, 2019 at 5:46 AM Kushagra Bindal <[hidden email]>
wrote:

> Chris,
>
> If you will check in my early email then you will find that with // it is
> throwing 404. But as soon as I removed it manually then it starts working
> properly and all these url were working fine in 8.5.24 version.
>
> On Tue, Dec 3, 2019, 1:21 AM Christopher Schultz <
> [hidden email]> wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA256
>>
>> Kushagra,
>>
>> On 12/2/19 11:29, Kushagra Bindal wrote:
>> > I think it should be.
>> >
>> > <filter>
>> > <description>DanglingSessionInvalidateFilter</description>
>> > <filter-name>DanglingSessionInvalidateFilter</filter-name>
>> > <filter-class>com.SessionInvalidateFilter</filter-class> </filter>
>> > <filter-mapping>
>> > <filter-name>DanglingSessionInvalidateFilter</filter-name>
>> > <url-pattern>/restcall/*</url-pattern> </filter-mapping>
>> >
>> > Here in below URL:
>> >
>> > "http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck"
>> >
>> > sdm will be the context path.
>> >
>> > But in another example that I shared in my last email, one use
>> > case http://backend_tomcat:8080//sdm/restcall)(.*)/file_uploads my
>> > context path itself contains //.
>> >
>> > So, please suggest a viable solution which we can try to solve
>> > this problem. :)
>> >
>> > Thanks in advance for your help & support in resolving this issue.
>>
>> All of these slashes really should be collapsed into a single slash
>> before processing. I don't see an issue. If the client requests:
>>
>>    http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck
>>
>> then the filter/servlet at /sdm/restcall/* will respond.
>>
>> If the client requests:
>>
>>    http://backend_tomcat:8080//sdm/restcall/foo/file_uploads
>>
>> Then the filter/servlet at /sdm/restcall/* will respond.
>>
>> It doesn't really matter how many extra slashes the client adds...
>> they should all be collapsed by the server and your application should
>> not have to make arrangements to handle them, add them back, or worry
>> about whether they are there or not.
>>
>> - -chris
>>
>> > On Mon, Dec 2, 2019 at 9:00 PM Mark Thomas <[hidden email]>
>> > wrote:
>> >
>> >> On 02/12/2019 10:59, Kushagra Bindal wrote:
>> >>> Hi Mark,
>> >>>
>> >>> These are Rest Endpoints, and so will be processed through
>> >>> Filter.
>> >>
>> >> That is unusual.
>> >>
>> >>> Do, you think Servlet mapping will play any role here?
>> >>
>> >> If the filter is handling them, no.
>> >>
>> >> So I'll change the question. Which URL pattern from the filter
>> >> mapping do you expect:
>> >>
>> >> "http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck"
>> >>
>> >>
>> >>
>> to match?
>> >>
>> >> The Context Path question still needs an answer.
>> >>
>> >> Mark
>> >>
>> >>
>> >>>
>> >>> On Mon, Dec 2, 2019 at 2:33 PM Mark Thomas <[hidden email]>
>> >>> wrote:
>> >>>
>> >>>> On 02/12/2019 04:53, Kushagra Bindal wrote:
>> >>>>> Hi Mark,
>> >>>>>
>> >>>>> Please find the snippet from web.xml
>> >>>>
>> >>>> Which URL pattern do you expect:
>> >>>>
>> >>>> "http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck"
>> >>>>
>> >>>>
>> >>>>
>> to match?
>> >>>>
>> >>>> And what is the Context Path at which the application is
>> >>>> deployed?
>> >>>>
>> >>>> Mark
>> >>>>
>> >>>>
>> >>>>>
>> >>>>> <servlet> <servlet-name>default</servlet-name>
>> >>>>>
>> >>>>>
>> >>>>
>> >> <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-c
>> lass>
>> >>>>>
>> >>
>> <init-param>
>> >>>>> <param-name>debug</param-name>
>> >>>>> <param-value>0</param-value> </init-param> <init-param>
>> >>>>> <param-name>listings</param-name>
>> >>>>> <param-value>false</param-value> </init-param>
>> >>>>> <load-on-startup>1</load-on-startup> </servlet> <servlet>
>> >>>>> <servlet-name>jsp</servlet-name>
>> >>>>>
>> >>>> <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
>> >>>>>
>> >>>>
>> <init-param>
>> >>>>> <param-name>fork</param-name>
>> >>>>> <param-value>false</param-value> </init-param>
>> >>>>> <init-param> <param-name>xpoweredBy</param-name>
>> >>>>> <param-value>false</param-value> </init-param>
>> >>>>> <load-on-startup>3</load-on-startup> </servlet> <!-- The
>> >>>>> mapping for the default servlet --> <servlet-mapping>
>> >>>>> <servlet-name>default</servlet-name>
>> >>>>> <url-pattern>/</url-pattern> </servlet-mapping> <!-- The
>> >>>>> mappings for the JSP servlet --> <servlet-mapping>
>> >>>>> <servlet-name>jsp</servlet-name>
>> >>>>> <url-pattern>*.jsp</url-pattern>
>> >>>>> <url-pattern>*.jspx</url-pattern> </servlet-mapping>
>> >>>>> <servlet>
>> >>>>> <servlet-name>PatternTemplateLaunchServlet</servlet-name>
>> >>>>> <servlet-class>PatternTemplateLaunchServlet</servlet-class>
>> >>>>>
>> >>>>>
>> </servlet>
>> >>>>> <servlet>
>> >>>>> <servlet-name>MyReportsLaunchServlet</servlet-name>
>> >>>>> <servlet-class>MyReportsLaunchServlet</servlet-class>
>> >>>>> </servlet> <servlet-mapping>
>> >>>>> <servlet-name>PatternTemplateLaunchServlet</servlet-name>
>> >>>>> <url-pattern>/patterntemplatelaunch</url-pattern>
>> >>>>> </servlet-mapping> <servlet-mapping>
>> >>>>> <servlet-name>MyReportsLaunchServlet</servlet-name>
>> >>>>> <url-pattern>/MyReportsLaunchServlet</url-pattern>
>> >>>>> </servlet-mapping>
>> >>>>>
>> >>>>> Please let me know if you need anyother details from our
>> >>>>> side.
>> >>>>>
>> >>>>> On Mon, Dec 2, 2019 at 3:07 AM Mark Thomas
>> >>>>> <[hidden email]> wrote:
>> >>>>>
>> >>>>>> On 01/12/2019 07:11, Kushagra Bindal wrote:
>> >>>>>>> Hi Manna/Mark,
>> >>>>>>>
>> >>>>>>> Below are the sample URL which we are passing to
>> >>>>>>> Tomcat.
>> >>>>>>>
>> >>>>>>> http://backend_tomcat:8080//sdm/restcall)(.*)/file_uploads
>> >>>>>>>
>> >>>>>>>
>> http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck
>> >>>>>>>
>> >>>>>>> As from the above example you can see that // location
>> >>>>>>> may vary case
>> >> by
>> >>>>>>> case.
>> >>>>>>>
>> >>>>>>> So, you guys have a probable solution to handle such
>> >>>>>>> situation, then
>> >>>>>> please
>> >>>>>>> do let me know.
>> >>>>>>
>> >>>>>> Tomcat is simply going to normalize those to single '/'.
>> >>>>>> The
>> >> application
>> >>>>>> should be fine with that.
>> >>>>>>
>> >>>>>> To repeat my previous request: Can you provide more
>> >>>>>> details such as: - an example request URI *and* - the
>> >>>>>> <url-pattern> for the servlet you expect it to match to
>> >>>>>>
>> >>>>>> Mark
>> >>>>>>
>> >>>>>> -----------------------------------------------------------------
>> - ----
>> >>>>>>
>> >>>>>>
>> To unsubscribe, e-mail: [hidden email]
>> >>>>>> For additional commands, e-mail:
>> >>>>>> [hidden email]
>> >>>>>>
>> >>>>>>
>> >>>>>
>> >>>>
>> >>>>
>> >>>> -------------------------------------------------------------------
>> - --
>> >>>>
>> >>>>
>> To unsubscribe, e-mail: [hidden email]
>> >>>> For additional commands, e-mail:
>> >>>> [hidden email]
>> >>>>
>> >>>>
>> >>>
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >>
>> >>
>> To unsubscribe, e-mail: [hidden email]
>> >> For additional commands, e-mail: [hidden email]
>> >>
>> >>
>> >
>> -----BEGIN PGP SIGNATURE-----
>> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
>>
>> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl3lazUACgkQHPApP6U8
>> pFj62hAAsXJM1uwsodox5AeVs6UCs1/uuUxHatmnd4LpKJzoHq8u2OEBNkUHEY/8
>> 46dJ/RtGBRcsgqA/sopbYjELtKUAwQPPKDEiD5DlpCg2ksyE75bTPb49PcO5a880
>> b2dyYAsfxpccApUXsTGasXriR0Mis/W7E1rqUy6TY7qo/PXVWR5bLFxc540+iEjf
>> Zuwi0l4cg43d2R8NABbsN7HQWu7rDBFJkeXWpVc5QXy/XdAkIgkgsBux1QaOcZgG
>> yf9saKknAwBqgMzPRvMEh6h4Lio/LRd1ido1M52X7Hqeuw7Kj9zzcnCF85LRZ73n
>> hkHUrMVvi++AELLzr+WhFSduJxrdtAfnRlXu7zYt6CfzxETu+t3g5c83/fF5QzDZ
>> nwdAKRmSPEMmVM8eczCrsYbFpITJjR71pRopFIKmJhrran6hFAn5vIUE5ay9QEv+
>> JUQqf9lrL5gQYUdaNqsAMe+JqYeiNLy8x/8y5qrUk/Jb2FtDx6yoJAUi9mFO/mCC
>> BsmnjEOE1TB9rylCzcSmHzJP6rYnd6pqoyCiq4NNAeaQBysIHKUwMWqMEEPrszED
>> P6MwKUUdzRuzX+SrLeRaIzqByRUzYtOuMP5IMPCB8tP2VE8R0J2txYyH2TMlBZgy
>> ZbcS3VB+kyz2RlX34bIN8gJZz7RQiSlATao0ux9A96KTbqMSIQs=
>> =c9w2
>> -----END PGP SIGNATURE-----
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>

--
Regards,
Kushagra Bindal
+91-9013792807
Reply | Threaded
Open this post in threaded view
|

Re: Double Slash Support in Tomcat 9.0.27

Mark Thomas-2
On 04/12/2019 05:16, Kushagra Bindal wrote:
> Hi Mark/Manna/Chris,
>
> Do we have any way out to handle this type of behavior?

All the evidence so far points to an application issue, not a Tomcat issue.

If you are able to create a simple test case that demonstrates a Tomcat
issue we can take a look.

Mark


>
> On Tue, Dec 3, 2019 at 5:46 AM Kushagra Bindal <[hidden email]>
> wrote:
>
>> Chris,
>>
>> If you will check in my early email then you will find that with // it is
>> throwing 404. But as soon as I removed it manually then it starts working
>> properly and all these url were working fine in 8.5.24 version.
>>
>> On Tue, Dec 3, 2019, 1:21 AM Christopher Schultz <
>> [hidden email]> wrote:
>>
> Kushagra,
>
> On 12/2/19 11:29, Kushagra Bindal wrote:
>>>>> I think it should be.
>>>>>
>>>>> <filter>
>>>>> <description>DanglingSessionInvalidateFilter</description>
>>>>> <filter-name>DanglingSessionInvalidateFilter</filter-name>
>>>>> <filter-class>com.SessionInvalidateFilter</filter-class> </filter>
>>>>> <filter-mapping>
>>>>> <filter-name>DanglingSessionInvalidateFilter</filter-name>
>>>>> <url-pattern>/restcall/*</url-pattern> </filter-mapping>
>>>>>
>>>>> Here in below URL:
>>>>>
>>>>> "http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck"
>>>>>
>>>>> sdm will be the context path.
>>>>>
>>>>> But in another example that I shared in my last email, one use
>>>>> case http://backend_tomcat:8080//sdm/restcall)(.*)/file_uploads my
>>>>> context path itself contains //.
>>>>>
>>>>> So, please suggest a viable solution which we can try to solve
>>>>> this problem. :)
>>>>>
>>>>> Thanks in advance for your help & support in resolving this issue.
>
> All of these slashes really should be collapsed into a single slash
> before processing. I don't see an issue. If the client requests:
>
>    http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck
>
> then the filter/servlet at /sdm/restcall/* will respond.
>
> If the client requests:
>
>    http://backend_tomcat:8080//sdm/restcall/foo/file_uploads
>
> Then the filter/servlet at /sdm/restcall/* will respond.
>
> It doesn't really matter how many extra slashes the client adds...
> they should all be collapsed by the server and your application should
> not have to make arrangements to handle them, add them back, or worry
> about whether they are there or not.
>
> -chris
>
>>>>> On Mon, Dec 2, 2019 at 9:00 PM Mark Thomas <[hidden email]>
>>>>> wrote:
>>>>>
>>>>>> On 02/12/2019 10:59, Kushagra Bindal wrote:
>>>>>>> Hi Mark,
>>>>>>>
>>>>>>> These are Rest Endpoints, and so will be processed through
>>>>>>> Filter.
>>>>>>
>>>>>> That is unusual.
>>>>>>
>>>>>>> Do, you think Servlet mapping will play any role here?
>>>>>>
>>>>>> If the filter is handling them, no.
>>>>>>
>>>>>> So I'll change the question. Which URL pattern from the filter
>>>>>> mapping do you expect:
>>>>>>
>>>>>> "http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck"
>>>>>>
>>>>>>
>>>>>>
> to match?
>>>>>>
>>>>>> The Context Path question still needs an answer.
>>>>>>
>>>>>> Mark
>>>>>>
>>>>>>
>>>>>>>
>>>>>>> On Mon, Dec 2, 2019 at 2:33 PM Mark Thomas <[hidden email]>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> On 02/12/2019 04:53, Kushagra Bindal wrote:
>>>>>>>>> Hi Mark,
>>>>>>>>>
>>>>>>>>> Please find the snippet from web.xml
>>>>>>>>
>>>>>>>> Which URL pattern do you expect:
>>>>>>>>
>>>>>>>> "http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck"
>>>>>>>>
>>>>>>>>
>>>>>>>>
> to match?
>>>>>>>>
>>>>>>>> And what is the Context Path at which the application is
>>>>>>>> deployed?
>>>>>>>>
>>>>>>>> Mark
>>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>> <servlet> <servlet-name>default</servlet-name>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>> <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-c
> lass>
>>>>>>>>>
>>>>>>
> <init-param>
>>>>>>>>> <param-name>debug</param-name>
>>>>>>>>> <param-value>0</param-value> </init-param> <init-param>
>>>>>>>>> <param-name>listings</param-name>
>>>>>>>>> <param-value>false</param-value> </init-param>
>>>>>>>>> <load-on-startup>1</load-on-startup> </servlet> <servlet>
>>>>>>>>> <servlet-name>jsp</servlet-name>
>>>>>>>>>
>>>>>>>> <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
>>>>>>>>>
>>>>>>>>
> <init-param>
>>>>>>>>> <param-name>fork</param-name>
>>>>>>>>> <param-value>false</param-value> </init-param>
>>>>>>>>> <init-param> <param-name>xpoweredBy</param-name>
>>>>>>>>> <param-value>false</param-value> </init-param>
>>>>>>>>> <load-on-startup>3</load-on-startup> </servlet> <!-- The
>>>>>>>>> mapping for the default servlet --> <servlet-mapping>
>>>>>>>>> <servlet-name>default</servlet-name>
>>>>>>>>> <url-pattern>/</url-pattern> </servlet-mapping> <!-- The
>>>>>>>>> mappings for the JSP servlet --> <servlet-mapping>
>>>>>>>>> <servlet-name>jsp</servlet-name>
>>>>>>>>> <url-pattern>*.jsp</url-pattern>
>>>>>>>>> <url-pattern>*.jspx</url-pattern> </servlet-mapping>
>>>>>>>>> <servlet>
>>>>>>>>> <servlet-name>PatternTemplateLaunchServlet</servlet-name>
>>>>>>>>> <servlet-class>PatternTemplateLaunchServlet</servlet-class>
>>>>>>>>>
>>>>>>>>>
> </servlet>
>>>>>>>>> <servlet>
>>>>>>>>> <servlet-name>MyReportsLaunchServlet</servlet-name>
>>>>>>>>> <servlet-class>MyReportsLaunchServlet</servlet-class>
>>>>>>>>> </servlet> <servlet-mapping>
>>>>>>>>> <servlet-name>PatternTemplateLaunchServlet</servlet-name>
>>>>>>>>> <url-pattern>/patterntemplatelaunch</url-pattern>
>>>>>>>>> </servlet-mapping> <servlet-mapping>
>>>>>>>>> <servlet-name>MyReportsLaunchServlet</servlet-name>
>>>>>>>>> <url-pattern>/MyReportsLaunchServlet</url-pattern>
>>>>>>>>> </servlet-mapping>
>>>>>>>>>
>>>>>>>>> Please let me know if you need anyother details from our
>>>>>>>>> side.
>>>>>>>>>
>>>>>>>>> On Mon, Dec 2, 2019 at 3:07 AM Mark Thomas
>>>>>>>>> <[hidden email]> wrote:
>>>>>>>>>
>>>>>>>>>> On 01/12/2019 07:11, Kushagra Bindal wrote:
>>>>>>>>>>> Hi Manna/Mark,
>>>>>>>>>>>
>>>>>>>>>>> Below are the sample URL which we are passing to
>>>>>>>>>>> Tomcat.
>>>>>>>>>>>
>>>>>>>>>>> http://backend_tomcat:8080//sdm/restcall)(.*)/file_uploads
>>>>>>>>>>>
>>>>>>>>>>>
> http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck
>>>>>>>>>>>
>>>>>>>>>>> As from the above example you can see that // location
>>>>>>>>>>> may vary case
>>>>>> by
>>>>>>>>>>> case.
>>>>>>>>>>>
>>>>>>>>>>> So, you guys have a probable solution to handle such
>>>>>>>>>>> situation, then
>>>>>>>>>> please
>>>>>>>>>>> do let me know.
>>>>>>>>>>
>>>>>>>>>> Tomcat is simply going to normalize those to single '/'.
>>>>>>>>>> The
>>>>>> application
>>>>>>>>>> should be fine with that.
>>>>>>>>>>
>>>>>>>>>> To repeat my previous request: Can you provide more
>>>>>>>>>> details such as: - an example request URI *and* - the
>>>>>>>>>> <url-pattern> for the servlet you expect it to match to
>>>>>>>>>>
>>>>>>>>>> Mark
>>>>>>>>>>
>>>>>>>>>> -----------------------------------------------------------------
> ----
>>>>>>>>>>
>>>>>>>>>>
> To unsubscribe, e-mail: [hidden email]
>>>>>>>>>> For additional commands, e-mail:
>>>>>>>>>> [hidden email]
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> -------------------------------------------------------------------
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

12