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

with_header_from_request for mock server #207

Closed
alex-kattathra-johnson opened this issue Nov 12, 2024 · 5 comments · Fixed by #208
Closed

with_header_from_request for mock server #207

alex-kattathra-johnson opened this issue Nov 12, 2024 · 5 comments · Fixed by #208

Comments

@alex-kattathra-johnson
Copy link
Contributor

The ability to respond with a specific header based on request.

@lipanski
Copy link
Owner

Not sure I understand what you mean - can you explain what you're missing? The library already provides a way to respond with a specific header (check the docs).

@alex-kattathra-johnson
Copy link
Contributor Author

I want to respond with a Sec-WebSocket-Accept header based on the key that is sent in the request header.

@lipanski
Copy link
Owner

Got it, so you need to set the response header to a dynamic value, like in Mock::with_body_from_request. I think this library could acommodate something like Mock::with_header_from_request with a similar signature. PRs are welcome ;)

@alex-kattathra-johnson
Copy link
Contributor Author

alex-kattathra-johnson commented Nov 12, 2024

@lipanski: Got you a PR! 😁

@lipanski
Copy link
Owner

@alex-kattathra-johnson Looks great, thanks.

Released as 1.6.1

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 a pull request may close this issue.

2 participants