diff --git a/Sources/App/Middleware/AppStoreAuthenticator.swift b/Sources/App/Middleware/AppStoreAuthenticator.swift index 8c4207f..d172ed2 100644 --- a/Sources/App/Middleware/AppStoreAuthenticator.swift +++ b/Sources/App/Middleware/AppStoreAuthenticator.swift @@ -64,6 +64,7 @@ struct AppStoreAuthenticator: HBAsyncAuthenticator { // (in the iOS and macOS client app: Bundle.main.appStoreReceiptURL) // However, the receipt is not available when testing in Xcode Sandbox, // so the server accepts a transaction Id in sandbox mode as well + let request = try await request.collateBody().get() guard let buffer = request.body.buffer, let body = buffer.getString(at: buffer.readerIndex, length: buffer.readableBytes) else { request.logger.error("/appstore invoked without app store receipt or transaction id in body") throw HBHTTPError(.badRequest)