Skip to content

Commit

Permalink
[RESTEASY-2559] Improper validation of response header in MediaTypeHe…
Browse files Browse the repository at this point in the history
…aderDelegate.java class
  • Loading branch information
spyrkob authored and asoldano committed May 11, 2020
1 parent a422eda commit f3e354b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ protected static boolean isValid(String str)
case '[':
case ']':
case '=':
case '\n':
return false;
default:
break;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.jboss.resteasy.test.mediatype;

import org.jboss.resteasy.plugins.delegates.MediaTypeHeaderDelegate;
import org.junit.Test;

public class MediaTypeHeaderTest {

@Test(expected = IllegalArgumentException.class)
public void testNewLineInHeaderValueIsRejected() {
MediaTypeHeaderDelegate delegate = new MediaTypeHeaderDelegate();

delegate.fromString("foo/bar\n");
}
}

0 comments on commit f3e354b

Please sign in to comment.