Skip to content

LIBDRUM-1005. "Restricted Access" pages return 401/403 to bots#96

Merged
mohideen merged 4 commits intodrum-mainfrom
feature/LIBDRUM-1005
Mar 31, 2026
Merged

LIBDRUM-1005. "Restricted Access" pages return 401/403 to bots#96
mohideen merged 4 commits intodrum-mainfrom
feature/LIBDRUM-1005

Conversation

@dsteelma-umd
Copy link
Copy Markdown

@dsteelma-umd dsteelma-umd commented Mar 11, 2026

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

@dsteelma-umd dsteelma-umd force-pushed the feature/LIBDRUM-1005 branch 3 times, most recently from 9baf9e9 to 3ae6d62 Compare March 12, 2026 11:31
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
@dsteelma-umd dsteelma-umd force-pushed the feature/LIBDRUM-1005 branch from 3ae6d62 to 555fe32 Compare March 12, 2026 11:39
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
@dsteelma-umd dsteelma-umd force-pushed the feature/LIBDRUM-1005 branch from c81f494 to a4d3514 Compare March 12, 2026 14:55
dsteelma-umd and others added 2 commits March 12, 2026 11:12
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
@dsteelma-umd dsteelma-umd force-pushed the feature/LIBDRUM-1005 branch from 256f548 to 2cd1c85 Compare March 12, 2026 15:52
@mohideen mohideen merged commit be20a5f into drum-main Mar 31, 2026
7 checks passed
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.

2 participants