camallo / dkregistry-rs

A pure-Rust asynchronous library for Docker Registry API v2
Apache License 2.0
62 stars 39 forks source link

fix: support 'charset=utf-8' parameter for application/json mimetype #175

Closed edwardgeorge closed 4 years ago

edwardgeorge commented 4 years ago

Seeing the charset param for application/json content-type present in the wild (in this case Azure CR), which was causing a strum error to be thrown when trying to construct the MediaTypes enum from the header.

Following the existing solution above in the enum this simply adds a second 'serialize' attribute param to the ApplicationJson variant.

It is noted that @steveeJ added a 'TODO' to find a generic way to handle these on the existing usage, but this is not addressed in this bugfix.

edwardgeorge commented 4 years ago

Ah, i just noticed that this is a duplicate of #113 which I somehow missed. So I will close this and comment there.

edwardgeorge commented 4 years ago

Ah, i just noticed that this is a duplicate of #113 which I somehow missed. So I will close this and comment there.

reading the discussion on that PR, this looks to be the correct fix for the issue I was experiencing: https://github.com/camallo/dkregistry-rs/pull/176