hazelcast / hazelcast-wm

Hazelcast filter-based Web Session Manager
Other
12 stars 31 forks source link

Consider using Properties#get when building filter #95

Closed enozcan closed 3 years ago

enozcan commented 3 years ago

https://github.com/hazelcast/hazelcast-wm/blob/d71ea59a3642ea1a4e28e39206be4bd703a6ea7d/src/main/java/com/hazelcast/web/WebFilterConfig.java#L371

might cause some properties to be ignored during programmatic configuration (i.e. as Spring bean). For instance,

Properties properties = new Properties();
properties.put("cookie-http-only", true);
new WebFilter(properties);

will create a wilter where cookie-http-only = false.

OmarMorales71 commented 3 years ago

@enozcan Hello, Can I work on this issue?

enozcan commented 3 years ago

Hi @OmarMorales71, Sure! I'm assigning this to you. Please ask if you have any questions regarding the issue.

OmarMorales71 commented 3 years ago

@enozcan Hello I'm trying to copy your case and I'm struggling to do it. To create the WebFilterConfig, I need to init the WebFilter but I need a FilterConfig. Do you have more information about how can I replicate your scenario? Thank you!

enozcan commented 3 years ago

You can find similar tests in WebFilterConfigTest. For instance, we need to have this simple one passing in WebFilterConfigTest.java:

@Test
public void testBooleanConfigValue() {
    Properties properties = new Properties();
    properties.put(WebFilterConfig.COOKIE_HTTP_ONLY, true);
    WebFilterConfig config = WebFilterConfig.create(emptyFilterConfig, properties);
    Assert.assertEquals(true, config.isCookieHttpOnly()); // to be fixed
}