-
Notifications
You must be signed in to change notification settings - Fork 66
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
Gather information from HTTP headers #58
Comments
I'm afraid adding this functionality will introduce dependency servlet package, which can be a concern for java 9 based apps. We could think about adding this to new repo so they could include this if require. Or we could make it load Servlet package based on Class.forName and if loaded use it, else ignore it. |
You could declare maven dependency on BTW, I don't understand why you singled out Java 9. Is there some change in Java 9 that would make this more complicated? |
In Java 9 each library should specify which modules they need and java will allow only those modules. So for this library to work fine in Java 9 enforced runtime, if we don't add module which allows servlet, then library will not be able to load those classes. So referring to classes without declaring it as dependent module, may lead it issues in Java 9 on. |
And why not declare the dependency on the servlet API? The Anyways, if adding server API dependency is not acceptable, the second best option is to publish a small extension library that only contains this functionality, so that people can add it if they need it. |
I am using this library server-side and I could use some easy way to gather basic information from HTTP headers. I am currently doing this:
This uses two helper methods. Method
ip()
decodes IP address fromX-Forwarded-For
if available:Method
language
parses language from request'sAccept-Language
header:Please consider adding this functionality into the library, so that people don't have to reimplement it for every project. Thanks!
The text was updated successfully, but these errors were encountered: