vertx-web
vertx-web copied to clipboard
Key inner class in CookieStoreImpl has bug with subdomains
Which version(s) did you encounter this bug ? 4.3.4
Context
I noticed that CookieStoreImpl improperly parses the domain when there are subdomains.
The problem comes from the following lines:
String[] tokens = domain.split("\\."); String tmp; for (int i = 0, j = tokens.length - 1; i < tokens.length / 2; ++i, --j) { tmp = tokens[j]; tokens[j] = tokens[i]; tokens[i] = tmp; } this.domain = String.join(".", tokens);
Do you have a reproducer?
new Key("test1.test2.ab.cd", "/", "name") //domain instance variable will be "cd.ab.test2.test1" (flipped)
- Anything that can be relevant such as OS version, JVM version
- Java 11
- Windows 10