-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Describe the bug
On iOS Companion, the Web component’s Delete
block sends a GET request when no body is provided. This causes servers to treat the call as a read instead of a delete.
Affects
- Designer
- Blocks editor
- Projects Explorer
- Android Companion
- iOS Companion
- Android Compiled APK/AAB
- iOS Compiled IPA
- Buildserver
- Debugging
- Other... (please describe)
Expected behavior
Calling Web.Delete
should send an HTTP request with method = "DELETE" (body optional, typically none).
The method must not fall back to "GET"
when the body is absent.
Steps to reproduce
- Create a project with a Web component.
- Set
Web.Url
to a test endpoint, e.g.https://httpbin.org/delete
(or your Beeceptor endpoint). - Trigger the
Web.Delete
block. - Inspect the received request on the server/test endpoint.
Actual result
Observed method = GET instead of DELETE when no request body is provided.
Additional context / suspected cause
In iOS implementation (components-ios/AIComponentKit/Web.swift
), request.httpMethod
is only set when a body is present (e.g., POST/PUT).
When postData
and postFile
are both nil
(typical for DELETE), the code never sets httpMethod
, so URLRequest
defaults to "GET".
Proposed fix: set request.httpMethod = httpVerb
unconditionally before handling the (optional) body.