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

suspicious behavior when checking ContentType #32

Open
AdrienDevillers opened this issue Sep 28, 2023 · 0 comments
Open

suspicious behavior when checking ContentType #32

AdrienDevillers opened this issue Sep 28, 2023 · 0 comments

Comments

@AdrienDevillers
Copy link

I'm currently setting up pact testing in my scala project with grpc and protobuf using pact4s

I had to modify a bit pact4s to be able to generate a V4Pact compatible with plugins,
when running the test Suite I get an error 415 Unsuported Media type

the line causing trouble is line 239 in mock_server.rs
Ok(content_type) => if content_type.base_type().to_string().starts_with("application/grpc")

I feel like the base_type function is not working properly, from what I understand it is replacing sub_type by suffix
and in my case I have the following contentType: "application/grpc+proto", the method base_type() will then transform it to "application/proto" which then fails the condition and returns an error 415,

I modified the plugin so that it only checks the sub-type and it worked.

am I missing something?

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

1 participant