File tree Expand file tree Collapse file tree 1 file changed +8
-15
lines changed
Sources/OpenAPIRuntime/Conversion Expand file tree Collapse file tree 1 file changed +8
-15
lines changed Original file line number Diff line number Diff line change @@ -77,30 +77,23 @@ extension Converter {
7777 // */* as a concrete content type is NOT a match for an Accept header of foo/*
7878 break
7979 case . anySubtype( type: let substringType) :
80+ // Only match if the types match.
8081 if substringType. lowercased ( ) == acceptType. lowercased ( ) {
8182 return
8283 }
83- case . concrete( type: let substringType, subtype: let substringSubtype) :
84- if
85- substringType. lowercased ( ) == acceptType. lowercased ( ) &&
86-
87- {
84+ case . concrete( type: let substringType, _) :
85+ if substringType. lowercased ( ) == acceptType. lowercased ( ) {
8886 return
8987 }
90-
91- if accept. lowercased ( ) == substringType. lowercased ( )
92- && subtype. lowercased ( ) == substringSubtype. lowercased ( )
88+ }
89+ case ( . concrete( type: let acceptType, subtype: let acceptSubtype) , let substring) :
90+ if case let . concrete( substringType, substringSubtype) = substring {
91+ if acceptType. lowercased ( ) == substringType. lowercased ( )
92+ && acceptSubtype. lowercased ( ) == substringSubtype. lowercased ( )
9393 {
9494 return
9595 }
9696 }
97-
98- case . concrete( type: let type, subtype: let subtype) :
99- if type. lowercased ( ) == substringType. lowercased ( )
100- && subtype. lowercased ( ) == substringSubtype. lowercased ( )
101- {
102- return
103- }
10497 }
10598 }
10699 throw RuntimeError . unexpectedAcceptHeader ( acceptHeader)
You can’t perform that action at this time.
0 commit comments