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.

Accept URIs without `none+` and return URIs without `none+`

See original GitHub issue

I see usability issues with none+ prefix in URI scheme:

  • A user must specify a URL that starts with none+ to create an HttpClient with a ClientBuilder.
    • We could assume none+ exists when a user did not prepend it.
    • It becomes a little bit more ambiguous, I think it will not be that confusing. It’s like removing 0 from 0.1 (= .1).
  • HttpClient.uri() returns a URI that starts with none+, which is somewhat confusing. For example, a user cannot convert the returned URI into a URL:
    HttpClient client = ...;
    client.uri().toURL(); // Fail
    

I’d like to:

  • Make the none+ prefix optional when creating a client.
  • Make ClientBuildParams.uri() return a URI without the none+ prefix.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
anuraagacommented, Oct 30, 2019

I guess that seems like overkill - it seems fine to me then for uri() to return a + or not based on serialization format as proposed.

0reactions
ikhooncommented, Nov 8, 2019

@rmohta Thanks for your interest.

Is it to be done only for none SerializationFormat, or for all?

IIRC, We have decided to apply only for none.

I am assuming, you would like as mentioned in below tests?

That’s right! It looks great.

By the way, our HTTP client doesn’t accept URL. https://github.com/line/armeria/blob/master/core/src/main/java/com/linecorp/armeria/client/HttpClient.java#L229

If we choose this policy, I guess creating an HTTP client from URL would be more natural.

HttpClient client1 =...
URL url = client1.uri().toURL();
HttpClient client2 = HttpClient.builder(url)...build()

@trustin @minwoox WDYT?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to filter non-resolvable URIs on a SPARQL query?
I would like to know if there is some specific FILTER that can be added in the SPARQL query to remove those results...
Read more >
Handling of non-file URI - Mathematica Stack Exchange
I can reproduce the problem both on OS X and one Windows, but only with URIs of the form foo:something . URIs of...
Read more >
Hypertext Style: Cool URIs don't change. - W3C
There are no reasons at all in theory for people to change URIs (or stop ... Except insolvency, nothing prevents the domain name...
Read more >
URI (Java Platform SE 7 ) - Oracle Help Center
An absolute URI specifies a scheme; a URI that is not absolute is said to be relative. URIs are also classified according to...
Read more >
Image URIs — sagemaker 2.121.1 documentation
sagemaker.image_uris. retrieve (framework, region, version=None, ... Ideally this function should not be called directly, rather it should be called from ...
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