Skip to content

Commit 4ee8b91

Browse files
Follow redirects on HEAD requests to ROR
Co-authored-by: Matyas Selmeci <matyas@cs.wisc.edu>
1 parent f366718 commit 4ee8b91

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

institutions-api/util/ror_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
def validate_ror_id(ror_id: Optional[str]):
88
""" Check whether an ROR ID is valid by performing a HEAD request to ror.org """
99
# TODO we might want to rate-limit this in some way
10-
if ror_id and requests.head(ror_id).status_code != 200:
10+
if ror_id and requests.head(ror_id, allow_redirects=True).status_code != 200:
1111
raise HTTPException(400, f"Invalid ROR ID: institution does not exist. See {ROR_ID_PREFIX}.")

0 commit comments

Comments
 (0)