viatoro / oauth

Automatically exported from code.google.com/p/oauth
0 stars 0 forks source link

net.oauth.client.URLConnectionResponse throws an unhandled exception in GoogleAppEngine #115

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a new project in GoogleAppEngine
2. Use oauth-consumer-20090617.jar
2. Run the attached servlet
3. See that it hits the NoSuchElementException

What is the expected output? What do you see instead?
I expect this sample code to throw a OAuthProblemException because I'm
using an invalid key and secret.   Instead I see that there is an unhandled
NoSuchElementException being raised by the GAE URLConnection implementation
and passing through the net.oauth code to be handled by my servlet. 

What version of the product are you using? On what operating system?
I'm using oauth-consumer-20090617.jar, GAE for Java version 1.2.2. 

Please provide any additional information below.
I think the real issue is in
com.google.apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler$Conne
ction
and I'm submitting a bug report to them as well.  It looks like from the
docs and from the code I've seen online, a URLConnection is meant to just
return null from URLConnection.getHeaderField, not throw an exception.  In
reality it is easier to fix net.oauth since I have access to the source.

Please see the attached patch for a fix.

Original issue reported on code.google.com by lpe...@gmail.com on 18 Aug 2009 at 6:27

Attachments:

GoogleCodeExporter commented 8 years ago
They're already aware of this bug:
http://groups.google.com/group/google-appengine-java/browse_thread/thread/546f96
7f0ff9d691/a4dff279584310ca?lnk=gst&q=URLConnection#a4dff279584310ca

And the defect report:
http://code.google.com/p/googleappengine/issues/detail?id=1945

Original comment by lpe...@gmail.com on 18 Aug 2009 at 6:32

GoogleCodeExporter commented 8 years ago

Original comment by jmkrist...@gmail.com on 23 Aug 2009 at 12:58

GoogleCodeExporter commented 8 years ago
fixed in -r1110

Original comment by jmkrist...@gmail.com on 23 Aug 2009 at 1:25