Re: [pubsubhubbub] Multiple Content-Type headers in notifications

106 views
Skip to first unread message

Roman

unread,
Mar 8, 2013, 12:17:36 PM3/8/13
to pubsub...@googlegroups.com
Thanks for the report, Björn!

This is indeed a bug in the implementation of http://pubsubhubbub.appspot.com/. Working on a fix...

Roman.

On Fri, Mar 8, 2013 at 5:19 PM, Björn Danielsson <goo...@lists.cuspycode.com> wrote:
I am new to pubsubhubbub. I just tried subscribing to a Google Alerts feed, and found that the callback requests contain multiple instances of the Content-Type header. The POST headers look like this:

Content-Type: application/atom+xml
Link: <http://pubsubhubbub.appspot.com/>; rel="hub"
X-Appengine-Country: ZZ
Content-Type: application/atom+xml
Host: xxx
Content-Length: 55287
Accept-Encoding: gzip

This is explicitly disallowed in RFC 2616 (section 4.2, last paragraph). The problem will not be noticed if the server simply discards the extra Content-type header, but in some circumstances the result is delivery failure. I am using the Apache httpd proxy_ajp module as a frontend to Apache TomEE where a JAX-RS application routes POST requests depending on their content-type. It turns out that proxy_ajp collapses multiple instances of the same HTTP header into a single instance with a comma-separated list of values, which RFC 2616 says is semantically equivalent for those headers that are allowed to have lists as values. So what the application sees is:

Content-Type: application/atom+xml, application/atom+xml

This value does not match any known content-type, and the request fails.

This is obviously a bug in proxy_ajp also, it shouldn't treat Content-Type headers like this. But the primary cause of the problem is the non-conforming nature of the original POSTs, so I am reporting it here first.

Thanks in advance for any replies & comments on this.

--
 
---
You received this message because you are subscribed to the Google Groups "Pubsubhubbub" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pubsubhubbub...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Roman

unread,
Mar 11, 2013, 12:10:57 PM3/11/13
to pubsub...@googlegroups.com, goo...@lists.cuspycode.com
Hi Björn,

I've made some changes in the hub that should have fixed the problem with duplicate Content-Type headers. Could you verify?

Roman.

Björn Danielsson

unread,
Mar 11, 2013, 3:33:13 PM3/11/13
to pubsub...@googlegroups.com, goo...@lists.cuspycode.com
Hi Roman,

Yes, confirmed, the problem disappeared in callbacks here from 16:38:20 UTC and onwards, according to my logs. Perfect! Thank you very much Roman.
Reply all
Reply to author
Forward
0 new messages