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
Resolved Issue #804 #862
Resolved Issue #804 #862
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dcstone09 Thanks for this! Instead of putting your test in a new file, please add to tests/test_intercept.js
.
@ianwsperber Thanks, I've moved the test over. |
tests/test_intercept.js
Outdated
@@ -196,6 +196,23 @@ test("reply should throw on error on the callback", function(t) { | |||
req.end(); | |||
}); | |||
|
|||
test('reply should not cause an error on header conflict', function (t) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ianwsperber This looks good.
@@ -73,6 +73,7 @@ Interceptor.prototype.reply = function reply(statusCode, body, rawHeaders) { | |||
|
|||
if (this.scope._defaultReplyHeaders) { | |||
headers = headers || {}; | |||
headers = common.headersFieldNamesToLowerCase(headers); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iangreenleaf This corrects the throwing conflict exception. Do we have test cases for testing overrides of the default headers when strings are loosely matching ('SomEthing' ==='something')?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@moaxaca Not sure off the top of my head
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ianwsperber This test could over that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 looks good to me
tests/test_intercept.js
Outdated
}); | ||
}); | ||
|
||
t.end() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dcstone09 Before ending the test, could we actually make a request to http://www.website.com/search
?IMO that would be a more complete assertion of the expected behavior.
@ianwsperber The test case has been updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue and add a reference to this one if it’s related. Thank you! |
Hello, I think this fixes #804. I am not sure where to put my test case exactly. Any feedback would be great thanks.