Skip to content

Commit

Permalink
Merge pull request #1300 from Lezh1k/main
Browse files Browse the repository at this point in the history
Use `get` instead of `head` in hidden API because of issues with NYSD court
  • Loading branch information
ERosendo authored Jan 20, 2025
2 parents 7b8ca10 + 5190085 commit 2839316
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions juriscraper/pacer/hidden_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,9 @@ def query(self, pacer_case_id, document_number, attachment_number=""):
)
)
logger.info(f"Querying the show_doc_url endpoint with URL: {url}")
# Only do a head request, else we get text content we don't need.
self.response = self.session.head(url, allow_redirects=True)
# we use get request because nysd court disabled all head requests
# and bans by IP in case head request is made
self.response = self.session.get(url, allow_redirects=True)
self.parse()

def _parse_text(self, text):
Expand Down

0 comments on commit 2839316

Please sign in to comment.