2.0.0 regression: @UriInfo always returns http as scheme
See original GitHub issueThis used to work in 1.3.x, but no longer seems to work in 2.0.0-rc12:
public class TestApplication extends Application<Configuration> {
@Override
public void run(Configuration configuration, Environment environment) throws Exception {
environment.jersey().register(TestResource.class);
}
public static void main(String[] args) throws Exception {
new TestApplication().run(args);
}
@Path("/")
public static class TestResource {
@GET
public String printUriInfoScheme(@Context UriInfo uriInfo) {
return uriInfo.getBaseUri().getScheme();
}
}
}
Always returns “http”, even if called using a https URL (e.g. using ngrok).
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
UriInfo (Java(TM) EE 7 Specification APIs) - Oracle Help Center
An injectable interface that provides access to application and request URI information. Relative URIs are relative to the base URI of the application, ......
Read more >chore(deps): update dependency io.quarkus:quarkus ... - GitLab
An error occurred while retrieving approval data for this merge request. chore(deps): update dependency io.quarkus:quarkus ...
Read more >Red Hat JBoss Fuse 6.3 Release Notes
UriInfo getHost caches first request's host and always returns that on subsequent calls. CXF-4817. JAX-RS AsyncResponse implementation needs ...
Read more >Release Notes - Cloudera Documentation
<project xmlns="http://maven.apache.org/POM/4.0.0" ... This function might not always return the fully qualified domain name,.
Read more >2009-January.txt - Jboss List Archives
The plan is to create a new UI component named UIDownload which has attributes ... due to the HttpServletRequest#getInputStream()#read() always returns 0.
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 Free
Top 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
Thanks, that seems to solve it! Seems to have changed from true to false by default between 1.3 and 2.0.
Other than that, our upgrade to 2.0.0 went really smooth so far - thanks for keeping Dropwizard up to date 👍
@creationw If you want to customize the behavior of the HTTP connector, you can create your own
HttpConnectorFactory
and override theHttpConnectorFactory#buildHttpConfiguration()
method in which you can register your own customizer similar to Jetty’sForwardedRequestCustomizer
.