You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current codec registration mechanism in the encoding package uses a strict map-based approach for matching codec names, which limits flexibility when handling variations in Content-Type headers. To address this, we propose enhancing the registeredCodecs map[string]Codec to support fuzzy matching. This enhancement will allow for more adaptable codec lookups. Given that the number of codec implementations is relatively small, this change is expected to have a minimal impact on performance.
Implementation mode
To implement this enhancement, we suggest introducing a fuzzy matching mechanism that can evaluate codec names based on pattern recognition or similarity scoring. This could be achieved through the use of existing fuzzy string matching libraries or by developing a custom algorithm tailored to the package's needs.
Usage demonstration
Consider a scenario where a request is sent with a Content-Type header of multipart/form-data; boundary=----WebKitFormBoundaryyb1zYhTI38xpQxBK. The proposed fuzzy matching system would enable the codec registration to match this header to a more generalized pattern like multipart/form-data; boundary=*. This would allow the system to handle variations in boundary values seamlessly.
Please request to consider this change and, if possible, assign it to me.
The text was updated successfully, but these errors were encountered:
Proposal description
The current codec registration mechanism in the
encoding
package uses a strict map-based approach for matching codec names, which limits flexibility when handling variations inContent-Type
headers. To address this, we propose enhancing theregisteredCodecs map[string]Codec
to support fuzzy matching. This enhancement will allow for more adaptable codec lookups. Given that the number of codec implementations is relatively small, this change is expected to have a minimal impact on performance.Implementation mode
To implement this enhancement, we suggest introducing a fuzzy matching mechanism that can evaluate codec names based on pattern recognition or similarity scoring. This could be achieved through the use of existing fuzzy string matching libraries or by developing a custom algorithm tailored to the package's needs.
Usage demonstration
Consider a scenario where a request is sent with a Content-Type header of
multipart/form-data; boundary=----WebKitFormBoundaryyb1zYhTI38xpQxBK
. The proposed fuzzy matching system would enable the codec registration to match this header to a more generalized pattern likemultipart/form-data; boundary=*
. This would allow the system to handle variations in boundary values seamlessly.Please request to consider this change and, if possible, assign it to me.
The text was updated successfully, but these errors were encountered: