Skip to content
This repository

copy all http request headers to outbound request #68

Merged
merged 1 commit into from over 1 year ago

2 participants

pksandeep Rob Fletcher
pksandeep

Hi,

TargetConnector is copying only the first HTTP header in the client request to outbound connection. I found out this issue while recording web service calls.

Please merge if it is fine.

Regards,
Sandeep

Rob Fletcher robfletcher merged commit 92ce137 into from October 12, 2012
Rob Fletcher robfletcher closed this October 12, 2012
Rob Fletcher
Owner

Thanks. I can't believe I made such a stupid mistake. I'll do a 1.0.1 release later today to fix it.

Rob Fletcher robfletcher referenced this pull request from a commit October 12, 2012
using `every` makes sense in the test for #68 5ce88d4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Oct 11, 2012
pksandeep copy all http request headers to outbound request f1baff4
This page is out of date. Refresh to see the latest.
2  src/main/groovy/co/freeside/betamax/proxy/handler/TargetConnector.groovy
@@ -40,7 +40,7 @@ class TargetConnector implements HttpHandler {
40 40
 
41 41
 	private HttpRequest createOutboundRequest(Request request) {
42 42
 		def outboundRequest = httpRequestFactory.newHttpRequest(request.method, request.uri.toString())
43  
-		request.headers.every { name, value ->
  43
+		request.headers.each { name, value ->
44 44
 			outboundRequest.addHeader(name, value)
45 45
 		}
46 46
 		outboundRequest.addHeader(VIA, VIA_HEADER)
2  src/test/groovy/co/freeside/betamax/proxy/handler/TargetConnectorSpec.groovy
@@ -62,7 +62,7 @@ class TargetConnectorSpec extends Specification {
62 62
 
63 63
 		then:
64 64
 		1 * httpClient.execute(_, _) >> { httpHost, outboundRequest ->
65  
-			request.headers.every { name, value ->
  65
+			request.headers.each { name, value ->
66 66
 				assert outboundRequest.getFirstHeader(name).value == value
67 67
 			}
68 68
 			okResponse
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.