Re: CORS

2011-12-01 Thread Benson Margulies
I've created org.apache.cxf.jaxrs.cors.CrossOriginResourceSharingFilter, which is gradually learning to pass all the tests I'm figuring out to write. It is a complete implementation of the spec AFAICT. On Sat, Nov 12, 2011 at 2:35 AM, K Fung kfung4...@gmail.com wrote: Hello, Are there any

Getting around HttpUrlConnection restrictions

2011-12-01 Thread Benson Margulies
There is a system property that disables it -- read once -- in a static block. Does anyone thing it would be possible to create an independent class loader and load this class into it a second time, with the property set, and then talk to it via reflection?

Re: Getting around HttpUrlConnection restrictions

2011-12-01 Thread Daniel Kulp
On Thursday, December 01, 2011 9:46:41 AM Benson Margulies wrote: There is a system property that disables it -- read once -- in a static block. Does anyone thing it would be possible to create an independent class loader and load this class into it a second time, with the property set, and

Re: Getting around HttpUrlConnection restrictions

2011-12-01 Thread Benson Margulies
On Thu, Dec 1, 2011 at 10:34 AM, Daniel Kulp dk...@apache.org wrote: On Thursday, December 01, 2011 9:46:41 AM Benson Margulies wrote: There is a system property that disables it -- read once -- in a static block. Does anyone thing it would be possible to create an independent class loader

Re: [proposal] Cross-Origin JAX-RS annotations

2011-12-01 Thread Benson Margulies
On Thu, Dec 1, 2011 at 10:34 AM, Sergey Beryozkin sberyoz...@gmail.com wrote: On 01/12/11 14:51, Benson Margulies wrote: I propose to add the following @CorsAllowAllOrigins @CorsAllowOrigins(  origin1., ... originN ) @CorsAllowMethods( meth1 ... methn ) @CorsExposeMethods( ... )

A moment of confusion about http headers and JAX-RS responses?

2011-12-01 Thread Benson Margulies
I should know this, but ... The CORS spec says: Split the value of the Origin header on the U+0020 SPACE character and if any of the resulting tokens is not a case-sensitive match for any of the values in list of origins do not set any additional headers and terminate this set of steps. Now, if

Re: Failing to set an Origin header with a WebClient

2011-12-01 Thread Benson Margulies
I'd rather write the transport. On Thu, Dec 1, 2011 at 11:13 AM, Sergey Beryozkin sberyoz...@gmail.com wrote: Hi Dan On 01/12/11 16:09, Daniel Kulp wrote: On Thursday, December 01, 2011 10:04:27 AM Sergey Beryozkin wrote: Hi Benson so HTTPUrlConnection drops 'Origin' ? It's unfortunate.

Re: A moment of confusion about http headers and JAX-RS responses?

2011-12-01 Thread Sergey Beryozkin
On 01/12/11 16:16, Benson Margulies wrote: I should know this, but ... The CORS spec says: Split the value of the Origin header on the U+0020 SPACE character and if any of the resulting tokens is not a case-sensitive match for any of the values in list of origins do not set any additional

An annotation utility I thought we would have

2011-12-01 Thread Benson Margulies
I'm a bit surprised that org.apache.cxf.jaxrs.utils.AnnotationUtils does not have a method that says: Here's a method and an annotation. If the method has the annotation, return it. Otherwise, go to the containing class, and it's parents, in search of it. Is there something I'm missing which

Re: An annotation utility I thought we would have

2011-12-01 Thread Daniel Kulp
On Thursday, December 01, 2011 11:48:45 AM Benson Margulies wrote: I'm a bit surprised that org.apache.cxf.jaxrs.utils.AnnotationUtils does not have a method that says: Here's a method and an annotation. If the method has the annotation, return it. Otherwise, go to the containing class, and

Re: An annotation utility I thought we would have

2011-12-01 Thread Benson Margulies
Doesn't help with methods, only with classes. But that still is less code to write than nothing at all. On Thu, Dec 1, 2011 at 11:56 AM, Daniel Kulp dk...@apache.org wrote: On Thursday, December 01, 2011 11:48:45 AM Benson Margulies wrote: I'm a bit surprised that

Re: An annotation utility I thought we would have

2011-12-01 Thread Benson Margulies
JAX-RS has an AnnotationUtils class that has other annotational goodies, and there's no annotation code in ReflectionUtil, so I think I'll follow the Alice's Restaurant principle. On Thu, Dec 1, 2011 at 11:56 AM, Daniel Kulp dk...@apache.org wrote: On Thursday, December 01, 2011 11:48:45 AM

Re: [proposal] Cross-Origin JAX-RS annotations

2011-12-01 Thread Benson Margulies
Sergey, I've hit a snag with preflight. In preflight, the client sends an OPTIONS with a 'requestMethod' and we have to decide if we like that method. This is section 6.1.5. The client sends OPTIONS with the method, a list of custom headers, and of course the full URL. I need to map that to the

Re: [proposal] Cross-Origin JAX-RS annotations

2011-12-01 Thread Benson Margulies
I forgot to ask, can you help me figure out which class is the right class for the information I've got?

Re: [proposal] Cross-Origin JAX-RS annotations

2011-12-01 Thread Sergey Beryozkin
Hi Benson On 01/12/11 18:36, Benson Margulies wrote: Sergey, I've hit a snag with preflight. In preflight, the client sends an OPTIONS with a 'requestMethod' and we have to decide if we like that method. This is section 6.1.5. The client sends OPTIONS with the method, a list of custom