LIBDRUM-1005. "Restricted Access" pages return 401/403 to bots#96
Merged
LIBDRUM-1005. "Restricted Access" pages return 401/403 to bots#96
Conversation
9baf9e9 to
3ae6d62
Compare
Corrects Google Search reports of "Soft 404" errors for the "Restricted Access" pages returned when a DSpace bitstream is embargoed or otherwise not available but returning either "401 Unauthorized" for anonymous users, or "403 Forbidden" for unauthorized users. This change only affects the Angular server-side rendering (SSR) functionality that is triggered by bots -- regular users will still see a "Restricted Access" page with a 200 OK response. Added unit tests to verify behavior. Co-authored-by: Perplexity AI <[email protected]> https://umd-dit.atlassian.net/browse/LIBDRUM-1005
3ae6d62 to
555fe32
Compare
The RestrictedAccessComponent has a code branch (and a specific message) when a filename is not provided, so added a test to verify that part of the code. Co-authored-by: Perplexity AI <[email protected]> https://umd-dit.atlassian.net/browse/LIBDRUM-1005
c81f494 to
a4d3514
Compare
Added "void" to "initTestBed" to fix a "no-floating-promises" warning from ESLint. This is okay, because the "initTestBed" function is only used within a "waitForAsync" block, which ensures that the promise is awaited and completed. Adding "void" signals to ESLint that Promise is intentionally not being awaited (as it is handled by "waitForAsync"). Co-authored-by: Perplexity AI <[email protected]> https://umd-dit.atlassian.net/browse/LIBDRUM-1005
These were overlooked in the initial cleanup. Co-authored-by: Perplexity AI <[email protected]> https://umd-dit.atlassian.net/browse/LIBDRUM-1005
256f548 to
2cd1c85
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Corrects Google Search reports of "Soft 404" errors for the "Restricted Access" pages returned when a DSpace bitstream is embargoed or otherwise not available but returning either "401 Unauthorized" for anonymous users, or "403 Forbidden" for unauthorized users.
This change only affects the Angular server-side rendering (SSR) functionality that is triggered by bots -- regular users will still see a "Restricted Access" page with a 200 OK response.
https://umd-dit.atlassian.net/browse/LIBDRUM-1005