Skip to content

Commit

Permalink
Simplify content type check
Browse files Browse the repository at this point in the history
  • Loading branch information
crazytonyli committed Feb 6, 2024
1 parent c4f376d commit aeb9bec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion WordPressKit/WordPressOrgXMLRPCApi.swift
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ private extension WordPressAPIResult<HTTPAPIResponse<Data>, WordPressOrgXMLRPCAp
}
}

if ["application/xml", "text/xml"].filter({ (type) -> Bool in return contentType.hasPrefix(type)}).count == 0 {
guard contentType.hasPrefix("application/xml") || contentType.hasPrefix("text/xml") else {
return .failure(.unparsableResponse(response: response.response, body: response.body, underlyingError: WordPressOrgXMLRPCApiError.unknown))
}

Expand Down

0 comments on commit aeb9bec

Please sign in to comment.