-
Notifications
You must be signed in to change notification settings - Fork 41
Fix: ignore not found error when fetching ACL so that a new one is initialized #1942
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
NSeydoux
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is fine, but I think more context in the comment would be helpful, to be kind to future us :p
src/acp/acp.ts
Outdated
| options | ||
| ); | ||
| } catch (e) { | ||
| // if the above fails, an ACL cannot be found and we proceed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be helpful to expand this comment a bit, to recontextualize why that's a correct behavior, rather than describing what the code does. For instance, remind that both ACL and ACR will be discovered through the same header, and that an additional lookup is required for checking the type of the resource, and that the absence of the resource is only possible in the case of an ACL, because in the ACR system the ACR is always present.
6fc6b27 to
1b64b47
Compare
NSeydoux
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you break down the comment in multiple lines before merging, so that this is roughly aligned with our linting config?
1b64b47 to
a9d4e73
Compare
Oops, thought I did. Fixed. |
This PR fixes #1549.
A 404 error was throwing, which was blocking the new ACL from being initialized when one was not found. In this PR, we ignore this error so that the function can resume and the ACL initialization can be handled.
// tests pending work on setting up CSS tests