Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Record&Replay: regex being send in place of the actual query or header value #61

Closed
rrabio opened this issue Nov 1, 2016 · 5 comments
Closed

Comments

@rrabio
Copy link

rrabio commented Nov 1, 2016

When a response is recorded with Record&Replay, the regex values in the header and query fields are used to create the request sent to the server specified in the response.body field. The actual value should be used instead.
Example:
a request such as :
http://myserver/Search?queryvalue=ciao

intercepted by the following yaml request:

  • request:
    method: GET
    url: /search
    query:
    queryvalue: "([a-zA-Z]+)"
    response:
    status: 200
    body: http://127.0.0.1:8888

will create an http request for 127.0.0.1:8888 that will contain a queryvalye=([a-zA-Z]+) rather than a queryvalue=ciao.

@rrabio
Copy link
Author

rrabio commented Nov 1, 2016

PS. great tool Alexander and thanks for sharing it!
I'm willing to fix the bug if you agree and propose a patch, if you can give me a few pointers on where and how.
Cheers

@azagniotov
Copy link
Owner

Hi @rrabio , thanks for reporting this. I already have a fix. Will you be able to build a SNAPSHOT from the master, once I push the fix and test it on your end before I deploy it to Maven Central?

@azagniotov
Copy link
Owner

azagniotov commented Nov 2, 2016

Fixed in version 4.0.4:

P.S.:
it is a little bit tricky with headers. Sending incoming request headers as-is can affect the recorded response. For now, sending only incoming request query string as-is

azagniotov added a commit that referenced this issue Nov 2, 2016
- Issue #61 : when record & play, stubbed regex query being sent in-place of the actual query
- Variable name refactoring & removal of harcoded strings
@rrabio
Copy link
Author

rrabio commented Nov 2, 2016

It works perfectly now, thanks!

@azagniotov
Copy link
Owner

Releasing version 4.0.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants