Core: absoluteURI of GET requests begin with http://0.0.0.0

31 views
Skip to first unread message

mathias

unread,
Jun 13, 2015, 5:21:12 AM6/13/15
to ve...@googlegroups.com

If the client sends a GET request to the server:

GET http://myserver:8080/path HTTP/1.1
Host: myserver:8080
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: de,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
Connection: keep-alive

I would expect the absoluteURI of the request to be "http://myserver:8080/path". I use this code to get the URI of the request:
router.route().method(HttpMethod.GET).path("/path").handler(routingContext -> {
     
try {
       
String requestURI = routingContext.request().absoluteURI();
       
...

Currently the class
HttpServerRequestImpl returns something different: "http://0.0.0.0:8080/path".

As a consequence the server metrics are built with this URI as well:
"vertx.http.servers.0.0.0.0:8080.get-requests" : {
   
"count" : 0,
   
"meanRate" : 0.0,
   
"oneMinuteRate" : 0.0,
   
"fiveMinuteRate" : 0.0,
   
"fifteenMinuteRate" : 0.0,
   
"rate" : "events/seconds",
   
"min" : 0.0,
   
"max" : 0.0,
   
"mean" : 0.0,
   
"stddev" : 0.0,
   
"median" : 0.0,
   
"75%" : 0.0,
   
"95%" : 0.0,
   
"98%" : 0.0,
   
"99%" : 0.0,
   
"99.9%" : 0.0,
   
"durationRate" : "milliseconds"
 
},

Is this an issue?

Tim Fox

unread,
Jun 13, 2015, 5:31:00 AM6/13/15
to ve...@googlegroups.com
Thanks matthias,

Can you add an issue with a reproducer please?

mathias

unread,
Jun 13, 2015, 9:20:14 AM6/13/15
to ve...@googlegroups.com
Yes. This was my first bugzilla ticket for the core project and I hope it is ok.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=470125

And the reproducer
https://github.com/leolux/vertx-absolute-uri

Jez P

unread,
Jun 13, 2015, 9:22:22 AM6/13/15
to ve...@googlegroups.com
I'd noticed similar as well, but thought it was some artifact of localhost on my development machine, and your reproducer looks fine to me.

Tim Fox

unread,
Jun 13, 2015, 9:52:09 AM6/13/15
to ve...@googlegroups.com
Thanks,

I have created a fix here https://github.com/eclipse/vert.x/pull/1073 - waiting for review
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages