question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

2.0.0 regression: @UriInfo always returns http as scheme

See original GitHub issue

This 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:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
BenRombergcommented, Nov 12, 2019

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 👍

0reactions
joschicommented, May 29, 2020

@creationw If you want to customize the behavior of the HTTP connector, you can create your own HttpConnectorFactory and override the HttpConnectorFactory#buildHttpConfiguration() method in which you can register your own customizer similar to Jetty’s ForwardedRequestCustomizer.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found