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

Header not matching value #57

Open
Xaponeis opened this issue Nov 11, 2024 · 3 comments
Open

Header not matching value #57

Xaponeis opened this issue Nov 11, 2024 · 3 comments

Comments

@Xaponeis
Copy link

Xaponeis commented Nov 11, 2024

I'm trying to use Faker with the " header" property like bellow, but the server ignores the "header-value", any value that I use for "X-custom-header", it returns the response. It only matches with the header title, if I do not send the header "X-custom-header", then no response is returned.

Anyone having this issue?

Example:

{
  "request": {
    "method": "GET",
    "path": "^\\/my-url\\?param1=.*\\&param2=my-param$",
	"headers": {
      "X-custom-header": "header-value"
    }
  },
  "response": {
     ....
@dotronglong
Copy link
Owner

@Xaponeis I think we only check for header's name in this case. I may look into it.

@Xaponeis
Copy link
Author

Thank you, really nice project, it was just what I was looking for, a easy to setup and lightweight API mocker.

@Xaponeis
Copy link
Author

Xaponeis commented Nov 15, 2024

@dotronglong First time playing aroung with Kotlin:
Allow matching header's value with regex.

That would solve my issue, although the downside I see is if someone is using a 'stable' tag in a docker image, could break the json mock if they are not expecting to match the header value. Maybe changing the tag version or creating a variable for when the header´s value is desired.

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