Forum Discussion
thijsbrentjens
12 years agoNew Contributor
Hi all,
Just a note that this issue can be fixed by adding a line of code in the following class (in this case for 4.5.1, which the application I'm working on is using):
https://github.com/SmartBear/soapui/blo ... sport.java
The problem rises because all headers of the originating request (I mean: the one that repsonds with a 301) are copied to a new request if the redirect is followed. This also includes the Host header. This is incorrect if the Location header includes a different host in the new URI than the originating request. The new request should have the Host of the new URI.
Adding the following to the class above at line 356:
Can this be fixed in the source code of SoapUI? Or should I create a pull request for that? And how to deal with this in other versions of SoapUI?
Just a note that this issue can be fixed by adding a line of code in the following class (in this case for 4.5.1, which the application I'm working on is using):
https://github.com/SmartBear/soapui/blo ... sport.java
The problem rises because all headers of the originating request (I mean: the one that repsonds with a 301) are copied to a new request if the redirect is followed. This also includes the Host header. This is incorrect if the Location header includes a different host in the new URI than the originating request. The new request should have the Host of the new URI.
Adding the following to the class above at line 356:
getMethod.setHeader("Host",uri.getHost());
Can this be fixed in the source code of SoapUI? Or should I create a pull request for that? And how to deal with this in other versions of SoapUI?