Comments (5)
@cescoffier thanks very much for the reproducer, it allows to quickly spot the problem
It looks like the problem is not related to HTTP/2, but to io.vertx.core.net.impl.HostAndPortImpl#parseHostAndPort
implementation. When an nip url is used, it assumes an IP address has been parsed, then expects a colon to be found, because the host+port string is larger than the parsed IP address length. Instead, it find the dot in .nip.io
and returns null:
public static HostAndPortImpl parseHostAndPort(String s, int schemePort) { // s is 127.0.0.1.nip.io:8443
int pos = parseHost(s, 0, s.length()); // pos is 9 because parseHost computes the host to be 127.0.0.1
if (pos == s.length()) {
return new HostAndPortImpl(s, schemePort);
}
if (pos < s.length() && s.charAt(pos) == ':') { // expected colon but finds dot
String host = s.substring(0, pos);
int port = 0;
while (++pos < s.length()) {
int digit = parseDigit(s, pos, s.length());
if (digit == -1) {
return null;
}
port = port * 10 + digit;
}
return new HostAndPortImpl(host, port);
}
return null; // returns null
}
Or did I miss something?
from vertx-web.
@cescoffier I've filed eclipse-vertx/vert.x#4947
When it's fixed, we'll see if there's another problem or not (unless you have more info in the meantime).
from vertx-web.
@cescoffier I've tried again with this patch and the problem goes away (the browser displays Hello World - https://127.0.0.1.nip.io:8443/
)
The reproducer was missing options.setUseAlpn(true);
so that HTTP/2 is negotiated between the client and the server. Even with this configuration, the browser displays the expected message (because the value is stored in the authority
header).
So, as far as I can see, there is no issue with HTTP/2, only a bug in Vert.x core related to nip hosts parsing. If you can provide more info, I'll take another look. Otherwise, I'll close this issue after merging eclipse-vertx/vert.x#4947
from vertx-web.
@tsegismont Thanks! I merged the PR.
from vertx-web.
Closing as this is a Vert.x core bug, fixed upstream eclipse-vertx/vert.x#4947
from vertx-web.
Related Issues (20)
- When upgrade vertx4, the path cannot support colon, and vertx 3 is ok HOT 1
- Use the new `OAuth2AuthorizationURL` in `OAuth2AuthHandler.extraParams`
- Reduce heavy atomic operations on RoutingContextImplBase HOT 6
- Rx Version of OAuth2AuthHandler Handler fails to add scopes HOT 2
- Vertx web randomly returns 404 error for certain POST requests even though for other similar requests it returns 200 HOT 2
- ChainAuthHandlerImpl#postAuthentication throws NPE HOT 5
- BodyHandler should not be added before the ProxyHandler HOT 3
- after RoutingContext.reroute(), TimeoutHandler still occured HOT 2
- Request to add localstorage-functonalities HOT 1
- GraphQL: Combination of request batching and Automatic Persisted Queries fails HOT 1
- New web client expectation, result type differ from error type HOT 5
- Exeptionhandler not working correctly HOT 5
- HTTP 1.0 request causes "Unhandled exception in router" HOT 5
- Catch all error handler
- openapi-router: Unsupported media type "application/octet-stream" but OpenApi 3.1.0 supports it HOT 4
- HTTP/1.0 requests without a host header must be handled by the router HOT 3
- Hope Validation can support custom message customization HOT 1
- ChainAuthHandlerImpl#postAuthentication throws IndexOutOfBoundsException HOT 4
- Manual session flushing example show complex ChainAuthHandler setup HOT 1
- Used VM option to config vert.x deployment option, But setter invoke method is Unreachable. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vertx-web.