Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MediaType improvement for malware attack against known route. #788

Closed
paul-hammant opened this issue May 23, 2017 · 0 comments
Closed

MediaType improvement for malware attack against known route. #788

paul-hammant opened this issue May 23, 2017 · 0 comments
Milestone

Comments

@paul-hammant
Copy link
Contributor

https://github.com/jooby-project/jooby/blob/master/jooby/src/main/java/org/jooby/MediaType.java#L533

This can throw exceptions, of course:

checkArgument(typeAndSubtype.length == 2, "Bad media type found '%s' while parsing '%s'",type, value);

Can they be caught locally, and rethrown as new BadMediaType(cause), please?

This way users of Jooby can have a error block, like so:

        err(BadMediaType.class, (req, rsp, err) -> {
            rsp.send("whatever);
        });

And perhaps BadMediaType is a subclass of RequestParsingException.

@jknack jknack added this to the 1.1.2 milestone May 23, 2017
@jknack jknack closed this as completed May 24, 2017
@jknack jknack reopened this May 26, 2017
@jknack jknack closed this as completed in 560ea5d May 26, 2017
jknack added a commit that referenced this issue May 26, 2017
MediaType improvement for malware attack against known route. fix  #788
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants