Skip to content
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

Use get instead of head in hidden API because of issues with NYSD court #1300

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading