ServletExternalContext#getHeaderValuesMap lowercasing

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

ServletExternalContext#getHeaderValuesMap lowercasing

ldeck
Hi all,

the above call to obtain the header values (prior to them being forwarded on, for example) is specifically calling .toLowerCase() on each of the header names.

@see https://github.com/orbeon/orbeon-forms/blob/master/src/main/java/org/orbeon/oxf/servlet/ServletExternalContext.java line 182.

This is breaking an xforms:submission of mine that previously authenticated against an existing rest service (which I don't have control over).

Does anyone have any suggestions for how I might intercept this?
Or can I suggest adding a configuration option for it, such that it can be turned off.

cheers,
Lachlan



--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: ServletExternalContext#getHeaderValuesMap lowercasing

Erik Bruchez
Administrator
Lachlan,

One problem is that Tomcat lowercases headers anyway, and we don't
have control over that. So we are just normalizing across Servlet
containers. See:

https://github.com/orbeon/orbeon-forms/issues/967

and:

http://grokbase.com/t/tomcat/users/0968njb9en/header-names-lower-case

Based on the above, the Tomcat maintainers don't seem to care. I think
that other containers, such as Netty, do better. But anyway we need to
support Tomcat.

What we do is that we try to recapitalize headers on the other side.
Recently, we have improved on this:

https://github.com/orbeon/orbeon-forms/blob/7594d15b93ecc5188e112e7383e3eaea69b91eb7/src/main/scala/org/orbeon/oxf/util/Headers.scala#L63

There is no general rule of capitalization I think, and so this will
work well with standard headers but not always with custom headers.
That improvement should be in 4.2 and later versions.

-Erik

On Tue, Aug 27, 2013 at 7:25 PM, Lachlan Deck <[hidden email]> wrote:

> Hi all,
>
> the above call to obtain the header values (prior to them being forwarded on, for example) is specifically calling .toLowerCase() on each of the header names.
>
> @see https://github.com/orbeon/orbeon-forms/blob/master/src/main/java/org/orbeon/oxf/servlet/ServletExternalContext.java line 182.
>
> This is breaking an xforms:submission of mine that previously authenticated against an existing rest service (which I don't have control over).
>
> Does anyone have any suggestions for how I might intercept this?
> Or can I suggest adding a configuration option for it, such that it can be turned off.
>
> cheers,
> Lachlan
>
>
>
> --
> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> To post to this group, send email to [hidden email].

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: ServletExternalContext#getHeaderValuesMap lowercasing

Erik Bruchez
Administrator
Thinking that for the proxy portlet, we try to keep the original
header case as specified in configuration properties, for header
forwarding:

https://github.com/orbeon/orbeon-forms/commit/59c26375511d6660f24e101d44130841381590c5

Not sure we do this for regular header forwarding though.

-Erik

On Wed, Aug 28, 2013 at 6:16 PM, Erik Bruchez <[hidden email]> wrote:

> Lachlan,
>
> One problem is that Tomcat lowercases headers anyway, and we don't
> have control over that. So we are just normalizing across Servlet
> containers. See:
>
> https://github.com/orbeon/orbeon-forms/issues/967
>
> and:
>
> http://grokbase.com/t/tomcat/users/0968njb9en/header-names-lower-case
>
> Based on the above, the Tomcat maintainers don't seem to care. I think
> that other containers, such as Netty, do better. But anyway we need to
> support Tomcat.
>
> What we do is that we try to recapitalize headers on the other side.
> Recently, we have improved on this:
>
> https://github.com/orbeon/orbeon-forms/blob/7594d15b93ecc5188e112e7383e3eaea69b91eb7/src/main/scala/org/orbeon/oxf/util/Headers.scala#L63
>
> There is no general rule of capitalization I think, and so this will
> work well with standard headers but not always with custom headers.
> That improvement should be in 4.2 and later versions.
>
> -Erik
>
> On Tue, Aug 27, 2013 at 7:25 PM, Lachlan Deck <[hidden email]> wrote:
>> Hi all,
>>
>> the above call to obtain the header values (prior to them being forwarded on, for example) is specifically calling .toLowerCase() on each of the header names.
>>
>> @see https://github.com/orbeon/orbeon-forms/blob/master/src/main/java/org/orbeon/oxf/servlet/ServletExternalContext.java line 182.
>>
>> This is breaking an xforms:submission of mine that previously authenticated against an existing rest service (which I don't have control over).
>>
>> Does anyone have any suggestions for how I might intercept this?
>> Or can I suggest adding a configuration option for it, such that it can be turned off.
>>
>> cheers,
>> Lachlan
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
>> To post to this group, send email to [hidden email].

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: ServletExternalContext#getHeaderValuesMap lowercasing

ldeck
In reply to this post by Erik Bruchez
Hi Erik,

thanks for the info. The issue for me is that this worked under orbeon 3.7 (old I know). I can see the outgoing custom headers are properly CapiTaLised whereas in the new version it's Capitalized.

I tried subclassing OrbeonServlet, and proxying the ExternalContext to recapitalize the header, but the outgoing headers don't include it at all after that. So I'm not sure what other code is doing this. Obviously this is a bit of a rabbit hole to continue down.

Essentially I'm wondering if there's a valid work-around?
cheers

On 29/08/2013, at 11:16 AM, Erik Bruchez <[hidden email]> wrote:

> Lachlan,
>
> One problem is that Tomcat lowercases headers anyway, and we don't
> have control over that. So we are just normalizing across Servlet
> containers. See:
>
> https://github.com/orbeon/orbeon-forms/issues/967
>
> and:
>
> http://grokbase.com/t/tomcat/users/0968njb9en/header-names-lower-case
>
> Based on the above, the Tomcat maintainers don't seem to care. I think
> that other containers, such as Netty, do better. But anyway we need to
> support Tomcat.
>
> What we do is that we try to recapitalize headers on the other side.
> Recently, we have improved on this:
>
> https://github.com/orbeon/orbeon-forms/blob/7594d15b93ecc5188e112e7383e3eaea69b91eb7/src/main/scala/org/orbeon/oxf/util/Headers.scala#L63
>
> There is no general rule of capitalization I think, and so this will
> work well with standard headers but not always with custom headers.
> That improvement should be in 4.2 and later versions.
>
> -Erik
>
> On Tue, Aug 27, 2013 at 7:25 PM, Lachlan Deck <[hidden email]> wrote:
>> Hi all,
>>
>> the above call to obtain the header values (prior to them being forwarded on, for example) is specifically calling .toLowerCase() on each of the header names.
>>
>> @see https://github.com/orbeon/orbeon-forms/blob/master/src/main/java/org/orbeon/oxf/servlet/ServletExternalContext.java line 182.
>>
>> This is breaking an xforms:submission of mine that previously authenticated against an existing rest service (which I don't have control over).
>>
>> Does anyone have any suggestions for how I might intercept this?
>> Or can I suggest adding a configuration option for it, such that it can be turned off.
>>
>> cheers,
>> Lachlan
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
>> To post to this group, send email to [hidden email].
>
> --
> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> To post to this group, send email to [hidden email].

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: ServletExternalContext#getHeaderValuesMap lowercasing

Erik Bruchez
Administrator
Lachlan,

Got it. What does your header name look like, and which property do
you use to forward it?

-Erik

On Fri, Aug 30, 2013 at 12:35 AM, Lachlan Deck <[hidden email]> wrote:

> Hi Erik,
>
> thanks for the info. The issue for me is that this worked under orbeon 3.7 (old I know). I can see the outgoing custom headers are properly CapiTaLised whereas in the new version it's Capitalized.
>
> I tried subclassing OrbeonServlet, and proxying the ExternalContext to recapitalize the header, but the outgoing headers don't include it at all after that. So I'm not sure what other code is doing this. Obviously this is a bit of a rabbit hole to continue down.
>
> Essentially I'm wondering if there's a valid work-around?
> cheers
>
> On 29/08/2013, at 11:16 AM, Erik Bruchez <[hidden email]> wrote:
>
>> Lachlan,
>>
>> One problem is that Tomcat lowercases headers anyway, and we don't
>> have control over that. So we are just normalizing across Servlet
>> containers. See:
>>
>> https://github.com/orbeon/orbeon-forms/issues/967
>>
>> and:
>>
>> http://grokbase.com/t/tomcat/users/0968njb9en/header-names-lower-case
>>
>> Based on the above, the Tomcat maintainers don't seem to care. I think
>> that other containers, such as Netty, do better. But anyway we need to
>> support Tomcat.
>>
>> What we do is that we try to recapitalize headers on the other side.
>> Recently, we have improved on this:
>>
>> https://github.com/orbeon/orbeon-forms/blob/7594d15b93ecc5188e112e7383e3eaea69b91eb7/src/main/scala/org/orbeon/oxf/util/Headers.scala#L63
>>
>> There is no general rule of capitalization I think, and so this will
>> work well with standard headers but not always with custom headers.
>> That improvement should be in 4.2 and later versions.
>>
>> -Erik
>>
>> On Tue, Aug 27, 2013 at 7:25 PM, Lachlan Deck <[hidden email]> wrote:
>>> Hi all,
>>>
>>> the above call to obtain the header values (prior to them being forwarded on, for example) is specifically calling .toLowerCase() on each of the header names.
>>>
>>> @see https://github.com/orbeon/orbeon-forms/blob/master/src/main/java/org/orbeon/oxf/servlet/ServletExternalContext.java line 182.
>>>
>>> This is breaking an xforms:submission of mine that previously authenticated against an existing rest service (which I don't have control over).
>>>
>>> Does anyone have any suggestions for how I might intercept this?
>>> Or can I suggest adding a configuration option for it, such that it can be turned off.
>>>
>>> cheers,
>>> Lachlan
>>>
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
>>> To post to this group, send email to [hidden email].
>>
>> --
>> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
>> To post to this group, send email to [hidden email].
>
> --
> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> To post to this group, send email to [hidden email].

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: ServletExternalContext#getHeaderValuesMap lowercasing

ldeck
Hi Erik,

the header is capitalised as previously mentioned -- something like MyCustomSession.

So in WEB-INF/resources/config/properties-local.xml
--
<property as="xs:string"  name="oxf.xforms.forward-submission-headers" value="Authorization Cookie MyCustomSession"/>
--

The resulting header, sniffing the outgoing traffic for orbeon 4.[1, 2, 3] is 'Mycustomsession'
(sorry I haven't tried 3.9)

I've also tried with the old orbeon and new in both tomcat 6 and 7. The old orbeon forwards them on as defined, the new orbeon alters them.





On 31/08/2013, at 1:32 AM, Erik Bruchez <[hidden email]> wrote:

> Lachlan,
>
> Got it. What does your header name look like, and which property do
> you use to forward it?
>
> -Erik
>
> On Fri, Aug 30, 2013 at 12:35 AM, Lachlan Deck <[hidden email]> wrote:
>> Hi Erik,
>>
>> thanks for the info. The issue for me is that this worked under orbeon 3.7 (old I know). I can see the outgoing custom headers are properly CapiTaLised whereas in the new version it's Capitalized.
>>
>> I tried subclassing OrbeonServlet, and proxying the ExternalContext to recapitalize the header, but the outgoing headers don't include it at all after that. So I'm not sure what other code is doing this. Obviously this is a bit of a rabbit hole to continue down.
>>
>> Essentially I'm wondering if there's a valid work-around?
>> cheers
>>
>> On 29/08/2013, at 11:16 AM, Erik Bruchez <[hidden email]> wrote:
>>
>>> Lachlan,
>>>
>>> One problem is that Tomcat lowercases headers anyway, and we don't
>>> have control over that. So we are just normalizing across Servlet
>>> containers. See:
>>>
>>> https://github.com/orbeon/orbeon-forms/issues/967
>>>
>>> and:
>>>
>>> http://grokbase.com/t/tomcat/users/0968njb9en/header-names-lower-case
>>>
>>> Based on the above, the Tomcat maintainers don't seem to care. I think
>>> that other containers, such as Netty, do better. But anyway we need to
>>> support Tomcat.
>>>
>>> What we do is that we try to recapitalize headers on the other side.
>>> Recently, we have improved on this:
>>>
>>> https://github.com/orbeon/orbeon-forms/blob/7594d15b93ecc5188e112e7383e3eaea69b91eb7/src/main/scala/org/orbeon/oxf/util/Headers.scala#L63
>>>
>>> There is no general rule of capitalization I think, and so this will
>>> work well with standard headers but not always with custom headers.
>>> That improvement should be in 4.2 and later versions.
>>>
>>> -Erik
>>>
>>> On Tue, Aug 27, 2013 at 7:25 PM, Lachlan Deck <[hidden email]> wrote:
>>>> Hi all,
>>>>
>>>> the above call to obtain the header values (prior to them being forwarded on, for example) is specifically calling .toLowerCase() on each of the header names.
>>>>
>>>> @see https://github.com/orbeon/orbeon-forms/blob/master/src/main/java/org/orbeon/oxf/servlet/ServletExternalContext.java line 182.
>>>>
>>>> This is breaking an xforms:submission of mine that previously authenticated against an existing rest service (which I don't have control over).
>>>>
>>>> Does anyone have any suggestions for how I might intercept this?
>>>> Or can I suggest adding a configuration option for it, such that it can be turned off.
>>>>
>>>> cheers,
>>>> Lachlan
>>>>
>>>>
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
>>>> To post to this group, send email to [hidden email].
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
>>> To post to this group, send email to [hidden email].
>>
>> --
>> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
>> To post to this group, send email to [hidden email].
>
> --
> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> To post to this group, send email to [hidden email].

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: ServletExternalContext#getHeaderValuesMap lowercasing

ldeck
just tested with orbeon 3.9 which also keeps the capitalisation for forwarded headers, so it's definitely changed in the 4.x series.
So if there's any work-around for 4.x that'd be great.

In the meantime I might need to work up a small rest service to act as a proxy so I can readjust the headers.
Cheers

On 31/08/2013, at 9:30 AM, Lachlan Deck <[hidden email]> wrote:

> Hi Erik,
>
> the header is capitalised as previously mentioned -- something like MyCustomSession.
>
> So in WEB-INF/resources/config/properties-local.xml
> --
> <property as="xs:string"  name="oxf.xforms.forward-submission-headers" value="Authorization Cookie MyCustomSession"/>
> --
>
> The resulting header, sniffing the outgoing traffic for orbeon 4.[1, 2, 3] is 'Mycustomsession'
> (sorry I haven't tried 3.9)
>
> I've also tried with the old orbeon and new in both tomcat 6 and 7. The old orbeon forwards them on as defined, the new orbeon alters them.
>
>
>
>
>
> On 31/08/2013, at 1:32 AM, Erik Bruchez <[hidden email]> wrote:
>
>> Lachlan,
>>
>> Got it. What does your header name look like, and which property do
>> you use to forward it?
>>
>> -Erik
>>
>> On Fri, Aug 30, 2013 at 12:35 AM, Lachlan Deck <[hidden email]> wrote:
>>> Hi Erik,
>>>
>>> thanks for the info. The issue for me is that this worked under orbeon 3.7 (old I know). I can see the outgoing custom headers are properly CapiTaLised whereas in the new version it's Capitalized.
>>>
>>> I tried subclassing OrbeonServlet, and proxying the ExternalContext to recapitalize the header, but the outgoing headers don't include it at all after that. So I'm not sure what other code is doing this. Obviously this is a bit of a rabbit hole to continue down.
>>>
>>> Essentially I'm wondering if there's a valid work-around?
>>> cheers
>>>
>>> On 29/08/2013, at 11:16 AM, Erik Bruchez <[hidden email]> wrote:
>>>
>>>> Lachlan,
>>>>
>>>> One problem is that Tomcat lowercases headers anyway, and we don't
>>>> have control over that. So we are just normalizing across Servlet
>>>> containers. See:
>>>>
>>>> https://github.com/orbeon/orbeon-forms/issues/967
>>>>
>>>> and:
>>>>
>>>> http://grokbase.com/t/tomcat/users/0968njb9en/header-names-lower-case
>>>>
>>>> Based on the above, the Tomcat maintainers don't seem to care. I think
>>>> that other containers, such as Netty, do better. But anyway we need to
>>>> support Tomcat.
>>>>
>>>> What we do is that we try to recapitalize headers on the other side.
>>>> Recently, we have improved on this:
>>>>
>>>> https://github.com/orbeon/orbeon-forms/blob/7594d15b93ecc5188e112e7383e3eaea69b91eb7/src/main/scala/org/orbeon/oxf/util/Headers.scala#L63
>>>>
>>>> There is no general rule of capitalization I think, and so this will
>>>> work well with standard headers but not always with custom headers.
>>>> That improvement should be in 4.2 and later versions.
>>>>
>>>> -Erik
>>>>
>>>> On Tue, Aug 27, 2013 at 7:25 PM, Lachlan Deck <[hidden email]> wrote:
>>>>> Hi all,
>>>>>
>>>>> the above call to obtain the header values (prior to them being forwarded on, for example) is specifically calling .toLowerCase() on each of the header names.
>>>>>
>>>>> @see https://github.com/orbeon/orbeon-forms/blob/master/src/main/java/org/orbeon/oxf/servlet/ServletExternalContext.java line 182.
>>>>>
>>>>> This is breaking an xforms:submission of mine that previously authenticated against an existing rest service (which I don't have control over).
>>>>>
>>>>> Does anyone have any suggestions for how I might intercept this?
>>>>> Or can I suggest adding a configuration option for it, such that it can be turned off.
>>>>>
>>>>> cheers,
>>>>> Lachlan
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
>>>>> To post to this group, send email to [hidden email].
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
>>>> To post to this group, send email to [hidden email].
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
>>> To post to this group, send email to [hidden email].
>>
>> --
>> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
>> To post to this group, send email to [hidden email].
>

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: ServletExternalContext#getHeaderValuesMap lowercasing

Erik Bruchez
Administrator
Lachlan,

The solution is probably to just fix this:

https://github.com/orbeon/orbeon-forms/issues/967

We do know the proper capitalization based on the spelling in the property.

-Erik

On Fri, Aug 30, 2013 at 4:53 PM, Lachlan Deck <[hidden email]> wrote:

> just tested with orbeon 3.9 which also keeps the capitalisation for forwarded headers, so it's definitely changed in the 4.x series.
> So if there's any work-around for 4.x that'd be great.
>
> In the meantime I might need to work up a small rest service to act as a proxy so I can readjust the headers.
> Cheers
>
> On 31/08/2013, at 9:30 AM, Lachlan Deck <[hidden email]> wrote:
>
>> Hi Erik,
>>
>> the header is capitalised as previously mentioned -- something like MyCustomSession.
>>
>> So in WEB-INF/resources/config/properties-local.xml
>> --
>> <property as="xs:string"  name="oxf.xforms.forward-submission-headers" value="Authorization Cookie MyCustomSession"/>
>> --
>>
>> The resulting header, sniffing the outgoing traffic for orbeon 4.[1, 2, 3] is 'Mycustomsession'
>> (sorry I haven't tried 3.9)
>>
>> I've also tried with the old orbeon and new in both tomcat 6 and 7. The old orbeon forwards them on as defined, the new orbeon alters them.
>>
>>
>>
>>
>>
>> On 31/08/2013, at 1:32 AM, Erik Bruchez <[hidden email]> wrote:
>>
>>> Lachlan,
>>>
>>> Got it. What does your header name look like, and which property do
>>> you use to forward it?
>>>
>>> -Erik
>>>
>>> On Fri, Aug 30, 2013 at 12:35 AM, Lachlan Deck <[hidden email]> wrote:
>>>> Hi Erik,
>>>>
>>>> thanks for the info. The issue for me is that this worked under orbeon 3.7 (old I know). I can see the outgoing custom headers are properly CapiTaLised whereas in the new version it's Capitalized.
>>>>
>>>> I tried subclassing OrbeonServlet, and proxying the ExternalContext to recapitalize the header, but the outgoing headers don't include it at all after that. So I'm not sure what other code is doing this. Obviously this is a bit of a rabbit hole to continue down.
>>>>
>>>> Essentially I'm wondering if there's a valid work-around?
>>>> cheers
>>>>
>>>> On 29/08/2013, at 11:16 AM, Erik Bruchez <[hidden email]> wrote:
>>>>
>>>>> Lachlan,
>>>>>
>>>>> One problem is that Tomcat lowercases headers anyway, and we don't
>>>>> have control over that. So we are just normalizing across Servlet
>>>>> containers. See:
>>>>>
>>>>> https://github.com/orbeon/orbeon-forms/issues/967
>>>>>
>>>>> and:
>>>>>
>>>>> http://grokbase.com/t/tomcat/users/0968njb9en/header-names-lower-case
>>>>>
>>>>> Based on the above, the Tomcat maintainers don't seem to care. I think
>>>>> that other containers, such as Netty, do better. But anyway we need to
>>>>> support Tomcat.
>>>>>
>>>>> What we do is that we try to recapitalize headers on the other side.
>>>>> Recently, we have improved on this:
>>>>>
>>>>> https://github.com/orbeon/orbeon-forms/blob/7594d15b93ecc5188e112e7383e3eaea69b91eb7/src/main/scala/org/orbeon/oxf/util/Headers.scala#L63
>>>>>
>>>>> There is no general rule of capitalization I think, and so this will
>>>>> work well with standard headers but not always with custom headers.
>>>>> That improvement should be in 4.2 and later versions.
>>>>>
>>>>> -Erik
>>>>>
>>>>> On Tue, Aug 27, 2013 at 7:25 PM, Lachlan Deck <[hidden email]> wrote:
>>>>>> Hi all,
>>>>>>
>>>>>> the above call to obtain the header values (prior to them being forwarded on, for example) is specifically calling .toLowerCase() on each of the header names.
>>>>>>
>>>>>> @see https://github.com/orbeon/orbeon-forms/blob/master/src/main/java/org/orbeon/oxf/servlet/ServletExternalContext.java line 182.
>>>>>>
>>>>>> This is breaking an xforms:submission of mine that previously authenticated against an existing rest service (which I don't have control over).
>>>>>>
>>>>>> Does anyone have any suggestions for how I might intercept this?
>>>>>> Or can I suggest adding a configuration option for it, such that it can be turned off.
>>>>>>
>>>>>> cheers,
>>>>>> Lachlan
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
>>>>>> To post to this group, send email to [hidden email].
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
>>>>> To post to this group, send email to [hidden email].
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
>>>> To post to this group, send email to [hidden email].
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
>>> To post to this group, send email to [hidden email].
>>
>
> --
> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> To post to this group, send email to [hidden email].

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: ServletExternalContext#getHeaderValuesMap lowercasing

ldeck
That's certainly the issue.
For now I've created a proxy service to fix the headers. So good to know it's on the radar :)
cheers

On 03/09/2013, at 10:27 AM, Erik Bruchez <[hidden email]> wrote:

> Lachlan,
>
> The solution is probably to just fix this:
>
> https://github.com/orbeon/orbeon-forms/issues/967
>
> We do know the proper capitalization based on the spelling in the property.
>
> -Erik
>
> On Fri, Aug 30, 2013 at 4:53 PM, Lachlan Deck <[hidden email]> wrote:
>> just tested with orbeon 3.9 which also keeps the capitalisation for forwarded headers, so it's definitely changed in the 4.x series.
>> So if there's any work-around for 4.x that'd be great.
>>
>> In the meantime I might need to work up a small rest service to act as a proxy so I can readjust the headers.
>> Cheers
>>
>> On 31/08/2013, at 9:30 AM, Lachlan Deck <[hidden email]> wrote:
>>
>>> Hi Erik,
>>>
>>> the header is capitalised as previously mentioned -- something like MyCustomSession.
>>>
>>> So in WEB-INF/resources/config/properties-local.xml
>>> --
>>> <property as="xs:string"  name="oxf.xforms.forward-submission-headers" value="Authorization Cookie MyCustomSession"/>
>>> --
>>>
>>> The resulting header, sniffing the outgoing traffic for orbeon 4.[1, 2, 3] is 'Mycustomsession'
>>> (sorry I haven't tried 3.9)
>>>
>>> I've also tried with the old orbeon and new in both tomcat 6 and 7. The old orbeon forwards them on as defined, the new orbeon alters them.
>>>
>>>
>>>
>>>
>>>
>>> On 31/08/2013, at 1:32 AM, Erik Bruchez <[hidden email]> wrote:
>>>
>>>> Lachlan,
>>>>
>>>> Got it. What does your header name look like, and which property do
>>>> you use to forward it?
>>>>
>>>> -Erik
>>>>
>>>> On Fri, Aug 30, 2013 at 12:35 AM, Lachlan Deck <[hidden email]> wrote:
>>>>> Hi Erik,
>>>>>
>>>>> thanks for the info. The issue for me is that this worked under orbeon 3.7 (old I know). I can see the outgoing custom headers are properly CapiTaLised whereas in the new version it's Capitalized.
>>>>>
>>>>> I tried subclassing OrbeonServlet, and proxying the ExternalContext to recapitalize the header, but the outgoing headers don't include it at all after that. So I'm not sure what other code is doing this. Obviously this is a bit of a rabbit hole to continue down.
>>>>>
>>>>> Essentially I'm wondering if there's a valid work-around?
>>>>> cheers
>>>>>
>>>>> On 29/08/2013, at 11:16 AM, Erik Bruchez <[hidden email]> wrote:
>>>>>
>>>>>> Lachlan,
>>>>>>
>>>>>> One problem is that Tomcat lowercases headers anyway, and we don't
>>>>>> have control over that. So we are just normalizing across Servlet
>>>>>> containers. See:
>>>>>>
>>>>>> https://github.com/orbeon/orbeon-forms/issues/967
>>>>>>
>>>>>> and:
>>>>>>
>>>>>> http://grokbase.com/t/tomcat/users/0968njb9en/header-names-lower-case
>>>>>>
>>>>>> Based on the above, the Tomcat maintainers don't seem to care. I think
>>>>>> that other containers, such as Netty, do better. But anyway we need to
>>>>>> support Tomcat.
>>>>>>
>>>>>> What we do is that we try to recapitalize headers on the other side.
>>>>>> Recently, we have improved on this:
>>>>>>
>>>>>> https://github.com/orbeon/orbeon-forms/blob/7594d15b93ecc5188e112e7383e3eaea69b91eb7/src/main/scala/org/orbeon/oxf/util/Headers.scala#L63
>>>>>>
>>>>>> There is no general rule of capitalization I think, and so this will
>>>>>> work well with standard headers but not always with custom headers.
>>>>>> That improvement should be in 4.2 and later versions.
>>>>>>
>>>>>> -Erik
>>>>>>
>>>>>> On Tue, Aug 27, 2013 at 7:25 PM, Lachlan Deck <[hidden email]> wrote:
>>>>>>> Hi all,
>>>>>>>
>>>>>>> the above call to obtain the header values (prior to them being forwarded on, for example) is specifically calling .toLowerCase() on each of the header names.
>>>>>>>
>>>>>>> @see https://github.com/orbeon/orbeon-forms/blob/master/src/main/java/org/orbeon/oxf/servlet/ServletExternalContext.java line 182.
>>>>>>>
>>>>>>> This is breaking an xforms:submission of mine that previously authenticated against an existing rest service (which I don't have control over).
>>>>>>>
>>>>>>> Does anyone have any suggestions for how I might intercept this?
>>>>>>> Or can I suggest adding a configuration option for it, such that it can be turned off.
>>>>>>>
>>>>>>> cheers,
>>>>>>> Lachlan
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
>>>>>>> To post to this group, send email to [hidden email].
>>>>>>
>>>>>> --
>>>>>> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
>>>>>> To post to this group, send email to [hidden email].
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
>>>>> To post to this group, send email to [hidden email].
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
>>>> To post to this group, send email to [hidden email].
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
>> To post to this group, send email to [hidden email].
>
> --
> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> To post to this group, send email to [hidden email].

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: ServletExternalContext#getHeaderValuesMap lowercasing

Erik Bruchez
Administrator
Lachlan, great to read that you have a workaround! -Erik

On Tue, Sep 3, 2013 at 12:19 AM, Lachlan Deck <[hidden email]> wrote:

> That's certainly the issue.
> For now I've created a proxy service to fix the headers. So good to know it's on the radar :)
> cheers
>
> On 03/09/2013, at 10:27 AM, Erik Bruchez <[hidden email]> wrote:
>
>> Lachlan,
>>
>> The solution is probably to just fix this:
>>
>> https://github.com/orbeon/orbeon-forms/issues/967
>>
>> We do know the proper capitalization based on the spelling in the property.
>>
>> -Erik
>>
>> On Fri, Aug 30, 2013 at 4:53 PM, Lachlan Deck <[hidden email]> wrote:
>>> just tested with orbeon 3.9 which also keeps the capitalisation for forwarded headers, so it's definitely changed in the 4.x series.
>>> So if there's any work-around for 4.x that'd be great.
>>>
>>> In the meantime I might need to work up a small rest service to act as a proxy so I can readjust the headers.
>>> Cheers
>>>
>>> On 31/08/2013, at 9:30 AM, Lachlan Deck <[hidden email]> wrote:
>>>
>>>> Hi Erik,
>>>>
>>>> the header is capitalised as previously mentioned -- something like MyCustomSession.
>>>>
>>>> So in WEB-INF/resources/config/properties-local.xml
>>>> --
>>>> <property as="xs:string"  name="oxf.xforms.forward-submission-headers" value="Authorization Cookie MyCustomSession"/>
>>>> --
>>>>
>>>> The resulting header, sniffing the outgoing traffic for orbeon 4.[1, 2, 3] is 'Mycustomsession'
>>>> (sorry I haven't tried 3.9)
>>>>
>>>> I've also tried with the old orbeon and new in both tomcat 6 and 7. The old orbeon forwards them on as defined, the new orbeon alters them.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On 31/08/2013, at 1:32 AM, Erik Bruchez <[hidden email]> wrote:
>>>>
>>>>> Lachlan,
>>>>>
>>>>> Got it. What does your header name look like, and which property do
>>>>> you use to forward it?
>>>>>
>>>>> -Erik
>>>>>
>>>>> On Fri, Aug 30, 2013 at 12:35 AM, Lachlan Deck <[hidden email]> wrote:
>>>>>> Hi Erik,
>>>>>>
>>>>>> thanks for the info. The issue for me is that this worked under orbeon 3.7 (old I know). I can see the outgoing custom headers are properly CapiTaLised whereas in the new version it's Capitalized.
>>>>>>
>>>>>> I tried subclassing OrbeonServlet, and proxying the ExternalContext to recapitalize the header, but the outgoing headers don't include it at all after that. So I'm not sure what other code is doing this. Obviously this is a bit of a rabbit hole to continue down.
>>>>>>
>>>>>> Essentially I'm wondering if there's a valid work-around?
>>>>>> cheers
>>>>>>
>>>>>> On 29/08/2013, at 11:16 AM, Erik Bruchez <[hidden email]> wrote:
>>>>>>
>>>>>>> Lachlan,
>>>>>>>
>>>>>>> One problem is that Tomcat lowercases headers anyway, and we don't
>>>>>>> have control over that. So we are just normalizing across Servlet
>>>>>>> containers. See:
>>>>>>>
>>>>>>> https://github.com/orbeon/orbeon-forms/issues/967
>>>>>>>
>>>>>>> and:
>>>>>>>
>>>>>>> http://grokbase.com/t/tomcat/users/0968njb9en/header-names-lower-case
>>>>>>>
>>>>>>> Based on the above, the Tomcat maintainers don't seem to care. I think
>>>>>>> that other containers, such as Netty, do better. But anyway we need to
>>>>>>> support Tomcat.
>>>>>>>
>>>>>>> What we do is that we try to recapitalize headers on the other side.
>>>>>>> Recently, we have improved on this:
>>>>>>>
>>>>>>> https://github.com/orbeon/orbeon-forms/blob/7594d15b93ecc5188e112e7383e3eaea69b91eb7/src/main/scala/org/orbeon/oxf/util/Headers.scala#L63
>>>>>>>
>>>>>>> There is no general rule of capitalization I think, and so this will
>>>>>>> work well with standard headers but not always with custom headers.
>>>>>>> That improvement should be in 4.2 and later versions.
>>>>>>>
>>>>>>> -Erik
>>>>>>>
>>>>>>> On Tue, Aug 27, 2013 at 7:25 PM, Lachlan Deck <[hidden email]> wrote:
>>>>>>>> Hi all,
>>>>>>>>
>>>>>>>> the above call to obtain the header values (prior to them being forwarded on, for example) is specifically calling .toLowerCase() on each of the header names.
>>>>>>>>
>>>>>>>> @see https://github.com/orbeon/orbeon-forms/blob/master/src/main/java/org/orbeon/oxf/servlet/ServletExternalContext.java line 182.
>>>>>>>>
>>>>>>>> This is breaking an xforms:submission of mine that previously authenticated against an existing rest service (which I don't have control over).
>>>>>>>>
>>>>>>>> Does anyone have any suggestions for how I might intercept this?
>>>>>>>> Or can I suggest adding a configuration option for it, such that it can be turned off.
>>>>>>>>
>>>>>>>> cheers,
>>>>>>>> Lachlan
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
>>>>>>>> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
>>>>>>>> To post to this group, send email to [hidden email].
>>>>>>>
>>>>>>> --
>>>>>>> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
>>>>>>> To post to this group, send email to [hidden email].
>>>>>>
>>>>>> --
>>>>>> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
>>>>>> To post to this group, send email to [hidden email].
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
>>>>> To post to this group, send email to [hidden email].
>>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
>>> To post to this group, send email to [hidden email].
>>
>> --
>> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
>> To post to this group, send email to [hidden email].
>
> --
> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> To post to this group, send email to [hidden email].

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].