Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(200)

Issue 207074: Catch URI parsing RuntimeException in OAuthRequest (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 11 months ago by johnfargo
Modified:
15 years, 10 months ago
Reviewers:
Paul Lindner, shindig.remailer
Base URL:
http://svn.apache.org/repos/asf/shindig/trunk/
Visibility:
Public.

Description

Improves error handling for this case.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -1 line) Patch
java/gadgets/src/main/java/org/apache/shindig/gadgets/oauth/OAuthRequest.java View 1 chunk +7 lines, -1 line 0 comments Download

Messages

Total messages: 4
johnfargo
15 years, 11 months ago (2010-02-12 00:57:36 UTC) #1
Paul Lindner
lgtm
15 years, 11 months ago (2010-02-12 01:03:10 UTC) #2
johnfargo
Thanks Paul; committed. On Thu, Feb 11, 2010 at 5:03 PM, <lindner@inuus.com> wrote: > lgtm ...
15 years, 11 months ago (2010-02-12 01:05:34 UTC) #3
zhoresh
15 years, 11 months ago (2010-02-12 01:06:24 UTC) #4
Maybe also catch error for decodeForm in line 497 and 591?

On Thu, Feb 11, 2010 at 4:57 PM, <johnfargo@gmail.com> wrote:

> Reviewers: shindig.remailer_gmail.com,
>
> Description:
> Improves error handling for this case.
>
> Please review this at http://codereview.appspot.com/207074/show
>
> Affected files:
>
>  java/gadgets/src/main/java/org/apache/shindig/gadgets/oauth/OAuthRequest.java
>
>
> Index:
> java/gadgets/src/main/java/org/apache/shindig/gadgets/oauth/OAuthRequest.java
> ===================================================================
> ---
> java/gadgets/src/main/java/org/apache/shindig/gadgets/oauth/OAuthRequest.java
>   (revision 909189)
> +++
> java/gadgets/src/main/java/org/apache/shindig/gadgets/oauth/OAuthRequest.java
>   (working copy)
> @@ -500,7 +500,13 @@
>       case URL_ONLY:
>         break;
>       case URL_AND_FORM_PARAMS:
> -
>  params.addAll(sanitize(OAuth.decodeForm(base.getPostBodyAsString())));
> +        try {
> +
>  params.addAll(sanitize(OAuth.decodeForm(base.getPostBodyAsString())));
> +        } catch (IllegalArgumentException e) {
> +          // Occurs if OAuth.decodeForm finds an invalid URL to decode.
> +          throw
> responseParams.oauthRequestException(OAuthError.INVALID_REQUEST,
> +              "Could not decode body", e);
> +        }
>         break;
>       case URL_AND_BODY_HASH:
>         try {
>
>
>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b