From 6869271d5476d438f05904bff1438d2fc20ddead Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Tue, 24 May 2022 22:49:16 -0700 Subject: [PATCH] A little safer and/or more dangerous way of checking content type --- apple/OmnivoreKit/Sources/Models/PageScrapePayload.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apple/OmnivoreKit/Sources/Models/PageScrapePayload.swift b/apple/OmnivoreKit/Sources/Models/PageScrapePayload.swift index 5b6ff9939..edf1baa42 100644 --- a/apple/OmnivoreKit/Sources/Models/PageScrapePayload.swift +++ b/apple/OmnivoreKit/Sources/Models/PageScrapePayload.swift @@ -26,7 +26,7 @@ public struct PageScrapePayload { // If the content type was specified and we know its PDF, use that // otherwise fallback to using file extensions. - if let contentType = contentType, contentType == "application/pdf" { + if let contentType = contentType, contentType.contains("pdf") { self.contentType = .pdf } else { self.contentType = url.hasSuffix(".pdf") ? .pdf : .html