shindig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ziv Horesh <zhor...@gmail.com>
Subject Re: Catch URI parsing RuntimeException in OAuthRequest (issue207074)
Date Fri, 12 Feb 2010 01:06:03 GMT
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 {
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message