Skip to content

Commit c8dc729

Browse files
committed
Fix server crash on iOS requests
1 parent 229a2bb commit c8dc729

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Sources/App/Middleware/AppStoreAuthenticator.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ struct AppStoreAuthenticator: HBAsyncAuthenticator {
6464
// (in the iOS and macOS client app: Bundle.main.appStoreReceiptURL)
6565
// However, the receipt is not available when testing in Xcode Sandbox,
6666
// so the server accepts a transaction Id in sandbox mode as well
67+
let request = try await request.collateBody().get()
6768
guard let buffer = request.body.buffer, let body = buffer.getString(at: buffer.readerIndex, length: buffer.readableBytes) else {
6869
request.logger.error("/appstore invoked without app store receipt or transaction id in body")
6970
throw HBHTTPError(.badRequest)

0 commit comments

Comments
 (0)