We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have encountered an interesting bug - trying to match a header value which contains a comma , results in incoming header value being parsed as Vec
,
What doesn't work, but I think it should
let mock_server = MockServer::start().await; Mock::given(header("if-modified-since", "Sat, 02 Apr 2005 20:37:00 GMT")) // This is valid RFC2822 .respond_with(ResponseTemplate::new(304)) .expect(1) .mount(&mock_server) .await; // This will return 404 let _result = reqwest::Client::new() .get(mock_server.uri()) .header("if-modified-since", "Sat, 02 Apr 2005 20:37:00 GMT") .send() .await .unwrap() .error_for_status() .unwrap();
Workaround I found:
let mock_server = MockServer::start().await; Mock::given(headers( "if-modified-since", vec!["Sat", "02 Apr 2005 20:37:00 GMT"], )) .respond_with(ResponseTemplate::new(304)) .expect(1) .mount(&mock_server) .await; // Returns 304 let _result = reqwest::Client::new() .get(mock_server.uri()) .header("if-modified-since", "Sat, 02 Apr 2005 20:37:00 GMT") .send() .await .unwrap() .error_for_status() .unwrap(); }
I have prepared a repository with a test that reproduces the issue: https://github.com/muttleyxd/wiremock-header-matcher-bug/blob/master/src/main.rs
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have encountered an interesting bug - trying to match a header value which contains a comma
,
results in incoming header value being parsed as VecWhat doesn't work, but I think it should
Workaround I found:
I have prepared a repository with a test that reproduces the issue: https://github.com/muttleyxd/wiremock-header-matcher-bug/blob/master/src/main.rs
The text was updated successfully, but these errors were encountered: