diff --git a/Sources/Hummingbird/Middleware/CORSMiddleware.swift b/Sources/Hummingbird/Middleware/CORSMiddleware.swift index b7f963b41..bc615df5e 100644 --- a/Sources/Hummingbird/Middleware/CORSMiddleware.swift +++ b/Sources/Hummingbird/Middleware/CORSMiddleware.swift @@ -113,6 +113,9 @@ public struct HBCORSMiddleware: HBMiddleware { return next.respond(to: request).map { response in var response = response response.headers.add(name: "access-control-allow-origin", value: self.allowOrigin.value(for: request) ?? "") + if self.allowCredentials { + response.headers.add(name: "access-control-allow-credentials", value: "true") + } if case .originBased = self.allowOrigin { response.headers.add(name: "vary", value: "Origin") }