Skip to content

suspicious behavior when checking ContentType  #32

@AdrienDevillers

Description

@AdrienDevillers

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions