You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Gary Gregory <ga...@gmail.com> on 2018/11/21 18:05:39 UTC

UriPatternMatcher.map is not sorted

Hi All:

I am going to change
org.apache.hc.core5.http.protocol.UriPatternMatcher.map from a HashMap to a
LinkedHashMap.

This is to allow a reverse proxy to be configured with UriPatternMatcher
that are processed by HttpCore in a predictable order, as opposed to the
current 'random' order.

This is valuable for v4 and 5. Since this seems to me like an
uncontroversial improvement, YMMV, I will commit it.

Thank you,
Gary

Re: UriPatternMatcher.map is not sorted

Posted by Michael Osipov <mi...@apache.org>.
Am 2018-11-24 um 16:04 schrieb Gary Gregory:
> On Sat, Nov 24, 2018 at 7:02 AM Michael Osipov <mi...@apache.org> wrote:
> 
>> Am 2018-11-21 um 20:23 schrieb Gary Gregory:
>>> On Wed, Nov 21, 2018 at 11:20 AM Michael Osipov <mi...@apache.org>
>> wrote:
>>>
>>>> Am 2018-11-21 um 19:05 schrieb Gary Gregory:
>>>>> Hi All:
>>>>>
>>>>> I am going to change
>>>>> org.apache.hc.core5.http.protocol.UriPatternMatcher.map from a HashMap
>>>> to a
>>>>> LinkedHashMap.
>>>>>
>>>>> This is to allow a reverse proxy to be configured with
>> UriPatternMatcher
>>>>> that are processed by HttpCore in a predictable order, as opposed to
>> the
>>>>> current 'random' order.
>>>>
>>>> What does the RFCs say to the order?
>>>>
>>>
>>> I can't imagine any RFC defines any behavior for how HttpCore works ;-)
>>
>> Not HttpCore, but maybe the order of headers. I was just thinking...
>>
> 
> This is not about the order of headers though. It's about the order in
> which you register patterns like "*" and "/foo/*" with
> AsyncServerBootstrap.register(String, Supplier<AsyncServerExchangeHandler>)

Really my bad. I'd retain the insertion order to avoid surprises...

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: UriPatternMatcher.map is not sorted

Posted by Gary Gregory <ga...@gmail.com>.
On Sat, Nov 24, 2018 at 7:02 AM Michael Osipov <mi...@apache.org> wrote:

> Am 2018-11-21 um 20:23 schrieb Gary Gregory:
> > On Wed, Nov 21, 2018 at 11:20 AM Michael Osipov <mi...@apache.org>
> wrote:
> >
> >> Am 2018-11-21 um 19:05 schrieb Gary Gregory:
> >>> Hi All:
> >>>
> >>> I am going to change
> >>> org.apache.hc.core5.http.protocol.UriPatternMatcher.map from a HashMap
> >> to a
> >>> LinkedHashMap.
> >>>
> >>> This is to allow a reverse proxy to be configured with
> UriPatternMatcher
> >>> that are processed by HttpCore in a predictable order, as opposed to
> the
> >>> current 'random' order.
> >>
> >> What does the RFCs say to the order?
> >>
> >
> > I can't imagine any RFC defines any behavior for how HttpCore works ;-)
>
> Not HttpCore, but maybe the order of headers. I was just thinking...
>

This is not about the order of headers though. It's about the order in
which you register patterns like "*" and "/foo/*" with
AsyncServerBootstrap.register(String, Supplier<AsyncServerExchangeHandler>)

Gary

Re: UriPatternMatcher.map is not sorted

Posted by Michael Osipov <mi...@apache.org>.
Am 2018-11-21 um 20:23 schrieb Gary Gregory:
> On Wed, Nov 21, 2018 at 11:20 AM Michael Osipov <mi...@apache.org> wrote:
> 
>> Am 2018-11-21 um 19:05 schrieb Gary Gregory:
>>> Hi All:
>>>
>>> I am going to change
>>> org.apache.hc.core5.http.protocol.UriPatternMatcher.map from a HashMap
>> to a
>>> LinkedHashMap.
>>>
>>> This is to allow a reverse proxy to be configured with UriPatternMatcher
>>> that are processed by HttpCore in a predictable order, as opposed to the
>>> current 'random' order.
>>
>> What does the RFCs say to the order?
>>
> 
> I can't imagine any RFC defines any behavior for how HttpCore works ;-)

Not HttpCore, but maybe the order of headers. I was just thinking...

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: UriPatternMatcher.map is not sorted

Posted by Gary Gregory <ga...@gmail.com>.
On Wed, Nov 21, 2018 at 11:20 AM Michael Osipov <mi...@apache.org> wrote:

> Am 2018-11-21 um 19:05 schrieb Gary Gregory:
> > Hi All:
> >
> > I am going to change
> > org.apache.hc.core5.http.protocol.UriPatternMatcher.map from a HashMap
> to a
> > LinkedHashMap.
> >
> > This is to allow a reverse proxy to be configured with UriPatternMatcher
> > that are processed by HttpCore in a predictable order, as opposed to the
> > current 'random' order.
>
> What does the RFCs say to the order?
>

I can't imagine any RFC defines any behavior for how HttpCore works ;-)

Gary

Re: UriPatternMatcher.map is not sorted

Posted by Michael Osipov <mi...@apache.org>.
Am 2018-11-21 um 19:05 schrieb Gary Gregory:
> Hi All:
> 
> I am going to change
> org.apache.hc.core5.http.protocol.UriPatternMatcher.map from a HashMap to a
> LinkedHashMap.
> 
> This is to allow a reverse proxy to be configured with UriPatternMatcher
> that are processed by HttpCore in a predictable order, as opposed to the
> current 'random' order.

What does the RFCs say to the order?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org