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

Should only support POST, PUT and PATCH verbs for worker endpoints #24

Closed
rubn-g opened this issue Aug 10, 2024 · 2 comments · Fixed by #25
Closed

Should only support POST, PUT and PATCH verbs for worker endpoints #24

rubn-g opened this issue Aug 10, 2024 · 2 comments · Fixed by #25
Labels
enhancement New feature or request released

Comments

@rubn-g
Copy link

rubn-g commented Aug 10, 2024

When a worker with a GET method is added, jobs fail with this error message:
request with GET/HEAD/OPTIONS method cannot have body

After checking the file worker-http-controller.ts i can see body is always set, no matter which endpoint method is used:
body: JSON.stringify({ job: job.toJSON(), token }),

Maybe body shouldn't be set if GET method is used?

@manast manast added the enhancement New feature or request label Aug 10, 2024
@manast
Copy link
Contributor

manast commented Aug 10, 2024

Although the HTTP specification does not prohibit sending a body in a GET call, it may be wise to not allow the GET verb when registering worker endpoints as in your case, for example, your server does not support it. I Will mark this issue as an enhancement.

@manast manast changed the title Error with GET method endpoints Should only support POST and PUT verbs for worker endpoints Aug 10, 2024
@manast manast changed the title Should only support POST and PUT verbs for worker endpoints Should only support POST, PUT and PATCH verbs for worker endpoints Aug 10, 2024
Copy link

🎉 This issue has been resolved in version 1.4.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants