[0.23] Error parsing address from Jetty with ipv6
See original GitHub issueRunning http4s 0.23.0-RC1 with Jetty and IPv6 crashes with the following:
ERROR org.http4s.servlet.Http4sServlet - Error processing request
java.util.NoSuchElementException: None.get
The issue is that Jetty returns the following addresses:
req.getLocalAddr -> "[0:0:0:0:0:0:0:1]"
req.getRemoteAddr -> "[0:0:0:0:0:0:0:1]"
This crashes the following parsing IpAddress.fromString(req.getRemoteAddr).get
in Http4sServlet. Is brackets on the address considered an error on the parsing side or on Jetty’s side?
A temporary workaround for us is to force ipv4 with -Djava.net.preferIPv4Stack=true
.
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Bind Jetty to IPv6 address - Stack Overflow
If you haven't found a solution, here it is. Change the NIO connector with the IO one. Instead of using "org.mortbay.jetty.nio.
Read more >error parsing IPv6 address in InternalHosts - Launchpad Bugs
I noticed several bugs with how parsing of the InternalHosts file is done. First of all exceptions are silently ignored, ...
Read more >Changelog - http4s
This release is binary compatible with the 0.23.x series. What's Changed . http4s-core . Prettify error messages when parsing by @danicheg...
Read more >[JSPT-106] IPv6 support with or without brackets around address
It was IDP-1694, it's been addressed. I strongly disagree with Jetty on this and they are misunderstanding what the brackets mean. Brackets ...
Read more >1484034 – glibc: Stricter IPv6 address parser - Red Hat Bugzilla
4 (so it has the same bug). ip6tables uses the glibc parser as well, so the change could cause ip6tables to reject invalid...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m sorry. That
stripBracketsFromAddr
already fixes this, and it wasn’t linked, so I neglected to close it. I’ll look for another one.Ohh okay , thanks