Skip to content

Commit 203e8ed

Browse files
committed
Disable cookies in EditorService
1 parent 6626ae7 commit 203e8ed

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

ios/Sources/GutenbergKit/Sources/Service/EditorService.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,10 @@ public actor EditorService {
451451
private func fetchData(for requestURL: URL, authHeader: String) async throws -> Data {
452452
var request = URLRequest(url: requestURL)
453453
request.setValue(authHeader, forHTTPHeaderField: "Authorization")
454+
// Prevent wordpress_logged_in cookies from being sent, which could interfere with
455+
// application password authentication in the Authorization header.
456+
// See: https://github.com/wordpress-mobile/GutenbergKit/commit/30ebac210924ecc8e9dee3980c101ef24b1befa6
457+
request.httpShouldHandleCookies = false
454458

455459
let (data, response) = try await networkSession.data(for: request)
456460
guard let status = (response as? HTTPURLResponse)?.statusCode,

0 commit comments

Comments
 (0)