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

Request headers are being lower-cases when they get to a Karate mock server #1505

Closed
staffier opened this issue Mar 4, 2021 · 3 comments
Closed

Comments

@staffier
Copy link

staffier commented Mar 4, 2021

Send a request to a Karate mock that has a header with an upper case letter. On the server side, "* print requestHeaders" will show that header in all lower case, and "* match requestHeadsers.[header_name][0] == '____'" will fail with the following:

match failed: EQUALS
$ | actual path does not exist (STRING:STRING)
'#notpresent'

KarateIssue.zip

@ptrthomas
Copy link
Member

closing as duplicate of #1360

IMPORTANT: please test the 1.0 RC and re-open this only if you see the same problem on that version: https://github.com/intuit/karate/wiki/1.0-upgrade-guide

@ptrthomas
Copy link
Member

ptrthomas commented Mar 4, 2021

p.s. and I'm still waiting for your feedback on #1430

I realize you have used the RC - but 3 things (and read #1360)

  • use the match header syntax to match headers, this takes case of case-insensitivity
  • the mock may or may not convert to lower case, this is allowed as per the spec
  • there is an option to configure lowerCaseResponseHeaders = true

@staffier
Copy link
Author

staffier commented Mar 4, 2021

Offline, Peter and I confirmed there is a work-around on the server side for this: just use "assert" instead of "match," e.g.

* assert headerContains('callerName', '[value]')

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

No branches or pull requests

2 participants