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

Splitting on , probably isn't a very good idea for XForwardedFilter configs…? #3

Open
hedefalk opened this issue Oct 12, 2020 · 1 comment

Comments

@hedefalk
Copy link

hedefalk commented Oct 12, 2020

I naively tried configuring with something like:

180.19..\d{1,3}.\d{1,3}

actually taken from the Java inlined defaults, but since the String based config will pre-split on , it doesn't work:

Caused by:
java.lang.IllegalArgumentException: Illegal pattern syntax '35\.19.\.\d{1'
	at fr.xebia.servlet.filter.XForwardedFilter.commaDelimitedListToPatternArray(XForwardedFilter.java:627)

@hedefalk hedefalk changed the title Splitting on , probably isn't a very good idea Splitting on , probably isn't a very good idea for XForwardedFilter configs…? Oct 12, 2020
@hedefalk
Copy link
Author

I mean, I read this:

* <td>Comma delimited list of regular expressions (in the syntax supported by the {@link java.util.regex.Pattern} library)</td>
 * <td>10\.\d{1,3}\.\d{1,3}\.\d{1,3}, 192\.168\.\d{1,3}\.\d{1,3}, 172\\.(?:1[6-9]|2\\d|3[0-1]).\\d{1,3}.\\d{1,3}, 
 * 169\.254\.\d{1,3}\.\d{1,3}, 127\.\d{1,3}\.\d{1,3}\.\d{1,3} <br/>
 * By default, 10/8, 192.168/16, 172.16/12, 169.254/16 and 127/8 are allowed</td>

but I can't do the commas in \d{1,3}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant