lilinkevin / rest-assured

Automatically exported from code.google.com/p/rest-assured
0 stars 0 forks source link

Replace host:port to baseUri in log when path contains query #304

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
given().log().all().expect().log().all().get("http://ya.ru/bla/?param");

What is the expected output? What do you see instead?

Expect in log:
Request method:    GET
Request path:    http://ya.ru/bla/?param
Request params:    <none>
Query params:    <none>
Form params:    <none>
Path params:    <none>
Headers:        Content-Type=*/*
Cookies:        <none>
Body:            <none>

Got:
Request method:    GET
Request path:    http://localhost:8080/bla/?param
Request params:    <none>
Query params:    <none>
Form params:    <none>
Path params:    <none>
Headers:        Content-Type=*/*
Cookies:        <none>
Body:            <none>

What version of the product are you using? On what operating system?
2.3.0, any OS

Please provide any additional information below.

Error in:
com.jayway.restassured.internal.RequestSpecificationImpl#generateRequestUriToLog

When we don't have query, we do (path is : http://ya.ru/bla/?param, targetPath 
is: only /bla/):
 } else {
      targetPath = path
 }

then use it to build log uri.

And when we have query, we send to build uri only path without host and after 
that host is baseUri host.

https://groups.google.com/forum/#!topic/rest-assured/IWhu34xL3rQ

Original issue reported on code.google.com by twilig...@gmail.com on 30 Jan 2014 at 10:01

GoogleCodeExporter commented 9 years ago
Thanks for reporting. This has now been fixed in master. Try out it by 
depending on version 2.3.1-SNAPSHOT after having added the following Maven repo:

<repositories>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
            <snapshots />
        </repository>
</repositories>

Original comment by johan.ha...@gmail.com on 30 Jan 2014 at 1:01

GoogleCodeExporter commented 9 years ago
It works now, thanks!

Original comment by twilig...@gmail.com on 30 Jan 2014 at 4:11

GoogleCodeExporter commented 9 years ago
Issue 305 has been merged into this issue.

Original comment by johan.ha...@gmail.com on 31 Jan 2014 at 1:33

GoogleCodeExporter commented 9 years ago
Pull request: https://github.com/jayway/rest-assured/pull/24

Original comment by twilig...@gmail.com on 31 Jan 2014 at 1:49

GoogleCodeExporter commented 9 years ago
Issue 305 has been merged into this issue.

Original comment by johan.ha...@gmail.com on 3 Feb 2014 at 7:50