mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-17 16:39:29 +00:00
Prior to this commit, the `MimeType` class would compare raw parameter values for the equals/hashcode contract. This went against the RFC which states that quoted and unquoted parameter values are equivalent. This commit rewrote the entire `MimeType` parser in `MimeTypeUtils` as a state parser to improve robustness and performance. The `MimeType` equals, compareTo and hascode contracts now unquote parameter values before comparing them. This change also optimizes the `tokenize` function that splits many comma-separated MIME types into a list. Now that this method isn't used anywhere else, it is also deprecated as of 7.1. This method was initially made public to be reused within Spring Framework and has no particular use in Spring applications in general. Finally, this also makes `MediaType` and `MimeType` leverage the `MimeType` LRU cache as much as possible, including when parsing `Accept:` HTTP headers. Closes gh-36729