[MGNLRES-405] ResourcesServlet doesn't catch JCR exception Created: 20/Sep/23  Updated: 20/Sep/23

Status: Open
Project: Magnolia Resources Module
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Phuong Dinh Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File image-2023-09-20-15-46-27-525.png     PNG File image-2023-09-20-15-46-42-548.png     PNG File image-2023-09-20-15-47-17-932.png     PNG File image-2023-09-20-15-47-56-340.png     PNG File image-2023-09-20-15-48-10-682.png     PNG File image-2023-09-20-15-48-25-943.png    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Visible to:
Annick Boehler, Minh Nguyen, Stanislav Misak

 Description   

Steps to reproduce

  1. Hit url with whitespace after “/“ https://www.swissre.com/.resources/swissre-web/webresources/img/logos/%20ns=netsparker(0x00%2001CA)
  2. Status code is 500


Expected results

MalformedPathException should be handled and throw another error code such as 404.

Actual results

Status code is 500 internal server error

Workaround

Write a custom ResourcesServlet to handle above exception

Development notes

  • In ResourcesServlet, do not catch exception when get resource
  • JcrResourceOrigin which implements ResourceOrigin throws MalformedPathException.

Generated at Mon Feb 12 06:50:20 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.