Skip to content

Commit

Permalink
Fix trailing slashes for mapping with additional attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
JoepdeJong committed May 20, 2024
1 parent c397ee3 commit f7d46ef
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public String overview(Model model, RedirectAttributes redirect, @PathVariable S
/**
*
*/
@GetMapping(value = "/overview/csv/{key}", produces = "text/csv")
@GetMapping(value = {"/overview/csv/{key}","/overview/csv/{key}/"}, produces = "text/csv")
public HttpEntity<? extends Object> csvExport(@PathVariable String key) {
try {
Event event = eventService.getByKey(key);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public String index(Model model) {
* Exports sales of month to csv
*
*/
@GetMapping(value="/csv", produces="text/csv")
@GetMapping(value = {"/csv", "/csv"}, produces="text/csv")
public HttpEntity<? extends Object> csvExport(@ModelAttribute SalesExportSubmission SalesExportSubmission, Model model) {
model.addAttribute("SalesExportSubmission", SalesExportSubmission);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public DocumentRestController(DocumentService documentService) {
* @return of type byte[]
*/
@ResponseBody
@GetMapping(value = "/{name}", produces = MediaType.IMAGE_PNG_VALUE)
@GetMapping(value = {"/{name}","/{name}/"}, produces = MediaType.IMAGE_PNG_VALUE)
public byte[] getImagePng(@PathVariable String name) {
return this.getDocumentBytes(name);
}
Expand All @@ -49,7 +49,7 @@ public byte[] getImagePng(@PathVariable String name) {
* @return of type byte[]
*/
@ResponseBody
@GetMapping(value = "/{name}", produces = MediaType.IMAGE_JPEG_VALUE)
@GetMapping(value = {"/{name}","/{name}/"}, produces = MediaType.IMAGE_JPEG_VALUE)
public byte[] getImageJpeg(@PathVariable String name) {
return this.getDocumentBytes(name);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public OrderRestController(PaymentsService paymentsService) {
*
* @return Status Message
*/
@RequestMapping(value = "/status", method = RequestMethod.POST)
@RequestMapping(value = {"/status","/status/"}, method = RequestMethod.POST)
public ResponseEntity<HttpStatus> updateOrderStatus(@RequestParam(name = "id") String providerReference) {
paymentsService.updateStatusByProviderReference(providerReference);
return new ResponseEntity<>(HttpStatus.OK);
Expand Down

0 comments on commit f7d46ef

Please sign in to comment.