Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edge Functions are invoked with POST only #362

Closed
niklasamslgruber opened this issue May 6, 2024 · 0 comments · Fixed by #367
Closed

Edge Functions are invoked with POST only #362

niklasamslgruber opened this issue May 6, 2024 · 0 comments · Fixed by #367
Labels
bug Something isn't working

Comments

@niklasamslgruber
Copy link

niklasamslgruber commented May 6, 2024

Bug report

Describe the bug

The FunctionsClient invokes all edge functions using http method POST and ignores the http method provided in FunctionInvokeOptions. This was introduced in this PR FunctionInvokeOptions

To Reproduce

Try to invoke any edge function with:

client.functions
            .invoke(
                "delete_user",
                options: FunctionInvokeOptions(
                    method: .delete
                )
            )

and observe them failing if they only accept a certain http method such as DELETE. The underlying rawInvoke method initializes a new request with method = .post instead of respecting the provided method.

Expected behavior

Edge Functions should be triggered with the specified http method from the FunctionInvokeOptions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant