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

Allow injection of additional headers in replay #43

Merged
merged 4 commits into from Oct 21, 2013
Merged

Allow injection of additional headers in replay #43

merged 4 commits into from Oct 21, 2013

Conversation

dcarley
Copy link
Collaborator

@dcarley dcarley commented Oct 18, 2013

Similar to curl(1) and siege(1):

  • Can be specified multiple times.
  • Will overwrite headers of the same key name in the original request.
  • An argument without a value (Foo:) will be set as empty.
  • Leading and trailing whitespace will be stripped from the key and value,
    otherwise it's difficult to determine where the key or value begin/end.

@buger
Copy link
Owner

buger commented Oct 19, 2013

@dcarley Can you describe possible usecases, except auth stuff?
Also pls update Readme and add basic test.

Thanks!

@dcarley
Copy link
Collaborator Author

dcarley commented Oct 19, 2013

Our immediate use is setting an HTTP header that triggers a feature flag in staging. So that we can selectively see how it performs under real traffic.

I've also been using it to modify User-Agent so that I can identify replayed requests in access logs and overwriting Host to replay against environments that respond to a different hostname.

I'll work on some tests; for argument validation and making sure the right thing appears in the request. Do you think they belong with the existing integration tests?

@buger
Copy link
Owner

buger commented Oct 19, 2013

Thanks! Definitly useful feature.

@buger
Copy link
Owner

buger commented Oct 19, 2013

Also wanted to ask if i can add your organization to list of companies using "Gor"? If so, i need organization name and URL. Thanks!

@dcarley
Copy link
Collaborator Author

dcarley commented Oct 19, 2013

Sure, "we" are the Government Digital Service :)

Run all tests + fix failing ES test
@dcarley
Copy link
Collaborator Author

dcarley commented Oct 20, 2013

I'll reopen when I'm done with the tests.

@dcarley dcarley closed this Oct 20, 2013
Similar to curl(1) and siege(1):

- Can be specified multiple times.
- Will overwrite headers of the same key name in the original request.
- An argument without a value (`Foo:`) will be set as empty.
- Leading and trailing whitespace will be stripped from the key and value,
  otherwise it's difficult to determine where the key or value begin/end.
Per the features described in the preceding commit.
Re-using one of the existing integration tests. If we were to refactor some
of the logic to send and receieve a single request then it would make sense
to split this, and the cookie validation, out to separate test cases.
@dcarley
Copy link
Collaborator Author

dcarley commented Oct 21, 2013

Now with tests.

@dcarley dcarley reopened this Oct 21, 2013
@buger
Copy link
Owner

buger commented Oct 21, 2013

Looks good! Pls update README.md

@dcarley
Copy link
Collaborator Author

dcarley commented Oct 21, 2013

Pls update README.md

It's in the first commit ;)

@buger
Copy link
Owner

buger commented Oct 21, 2013

Oh, awesome. Merging :)

buger added a commit that referenced this pull request Oct 21, 2013
Allow injection of additional headers in replay
@buger buger merged commit 69df96e into buger:master Oct 21, 2013
@dcarley dcarley deleted the replay_header_injection branch October 21, 2013 12:45
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

Successfully merging this pull request may close these issues.

None yet

2 participants