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

Web endpoints should only accept GET or POST or both as appropriate #1456

Closed
wants to merge 1 commit into from

Conversation

dsyer
Copy link
Contributor

@dsyer dsyer commented Aug 4, 2023

All the endpoints in initializr use @RequestMapping with no explicit RequestMethod, probably for historical reasons (@GetMapping and friends didn't exist when we started this project). It would be more expressive to show which methods are expected to be used, and I doubt anyone actually relies on being able to PATCH, PUT or POST these endpoints. They might get a surprise if they tried to DELETE as well.

Fixes #1453

All the endpoints in initializr use @RequestMapping with no explicit RequestMethod,
probably for historical reasons (@GetMapping and friends didn't exist when we
started this project). It would be more expressive to show which methods are expected
to be used, and I doubt anyone actually relies on being able to PATCH, PUT or POST
these endpoints. They might get a surprise if they tried to DELETE as well.
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 4, 2023
@snicoll snicoll changed the title Only accept GET or POST or both as approriate Web endpoints should only accept GET or POST or both as approriate Aug 9, 2023
@snicoll snicoll added type: bug and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 9, 2023
@snicoll snicoll added this to the 0.20.1 milestone Aug 9, 2023
@snicoll snicoll changed the title Web endpoints should only accept GET or POST or both as approriate Web endpoints should only accept GET or POST or both as appropriate Sep 8, 2023
@snicoll snicoll self-assigned this Sep 8, 2023
snicoll pushed a commit that referenced this pull request Sep 8, 2023
All the endpoints in initializr use @RequestMapping with no explicit
RequestMethod, probably for historical reasons (@GetMapping and friends
didn't exist when we started this project). It would be more expressive
to show which methods are expected to be used, and I doubt anyone
actually relies on being able to PATCH, PUT or POST these endpoints.

They might get a surprise if they tried to DELETE as well.

See gh-1456
snicoll added a commit that referenced this pull request Sep 8, 2023
@snicoll snicoll closed this in 3f9be17 Sep 8, 2023
@snicoll
Copy link
Contributor

snicoll commented Sep 8, 2023

Thanks Dave

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use @GetMapping etc. where possible
3 participants