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

Render 404 Not Found for invalid problem filelink path #259

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tom93
Copy link
Contributor

@tom93 tom93 commented Jan 8, 2024

(Minor)

Previously, /problems/:id/files/download/:path with a non-existent path would crash with Pundit::NotDefinedError (unable to find policy of nil), because find_by_filepath returns nil if the record is not found and then authorize @filelink, :show? fails.

Previously, /problems/:id/files/download/:path with a non-existent
path would crash with Pundit::NotDefinedError (unable to find policy
of nil), because `find_by_filepath` returns nil if the record is not
found and then `authorize @filelink, :show?` fails.
@tom93 tom93 force-pushed the fix-filelink-path-404 branch from 923f2cd to 571fe40 Compare January 8, 2024 12:31
@coveralls
Copy link

coveralls commented Jan 8, 2024

Coverage Status

coverage: 37.131%. remained the same
when pulling 571fe40 on fix-filelink-path-404
into 99b2e7c on master.

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

Successfully merging this pull request may close these issues.

3 participants