404 error after hit Resource Link of File Asset with Permissions
After giving permissions to a File Asset and try to hit the Resource Link, the user is redirected to the login page but the referrer is wrong and after successfully log in is redirected to a 404 page.
If the user tries to hit the Resource Link again (logged in), the File Asset is returned just fine.
Client Ticket: https://my.dotcms.com/tickets/detail.dot?id=afb33354-d68f-4a71-a4b1-797034757620
Expected Behavior
We need to set the referrer value properly and after log in, redirect the user to the File Asset asked originally.
Current Behavior
Referrer is set to "/dotasset/" without identifier or inode.
Possible Solution
Hotfix provided, linked below.
Known Workarounds
Use /dotAsset/[Identifier] instead Resource Link.
Steps to Reproduce (for bugs)
- Site Browser -> Create a test folder on root.
- Upload a File Asset into that folder.
- Remove CMS anon permission and add only Admin User View Permission.
- Go to front end and try to hit the Resource Link.
- Log in with Admin credentials.
- 404 error.
Your Environment
- dotCMS version used: 3.3.2 and 3.6.0
- Browser Name and version: Chrome - latest.
- Operating System and version: Mac OS X
- Application Server and version: Tomcat 8
- Java Brand and version: Java 8
- Database and version: H2 and Postgres
Important Notes
I will implement the hotfix for 3.3.2 but the fix for the current release needs to be aware of the language of the file also.
Hotfix: https://github.com/dotCMS/support/tree/master/hotfixes/hotfix-GIT-9996_v3.3.2
PR: https://github.com/dotCMS/core/pull/10517
Hey Guys, this Pull Request is intended to include changes previously done as part of hotfix into master-3-7 branch. Thanks!
Passed QA. After logging in, the user is redirected to the File Asset asked originally. User is not being redirected to a 404 page as before. Tested with started data and cliente data. Database used: Postgres 9.3.5 / MySQL 5.6.23 Operating System: Ubuntu 14.04.1 / Mac OS 10.10.5