Skip to content

Commit

Permalink
whew
Browse files Browse the repository at this point in the history
  • Loading branch information
stringertheory committed Jan 31, 2024
1 parent 9baa1af commit fe99db3
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 1 deletion.
2 changes: 1 addition & 1 deletion clean_links/unshorten.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def request_redirect_chain(
# send and follow the redirect chain, filling in the history
next_prepped = send(session, prepped, history, verify, timeout)
while next_prepped:
next_prepped = send(session, prepped, history, verify, timeout)
next_prepped = send(session, next_prepped, history, verify, timeout)

return history

Expand Down
100 changes: 100 additions & 0 deletions tests/cassettes/test_unshorten/test_invalid_url_in_redirect_chain.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
interactions:
- request:
body: null
headers:
Connection:
- keep-alive
accept:
- text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
accept-encoding:
- gzip, deflate, br
accept-language:
- en-US,en;q=0.9
sec-fetch-dest:
- document
sec-fetch-mode:
- navigate
sec-fetch-site:
- same-origin
sec-fetch-user:
- ?1
upgrade-insecure-requests:
- '1'
user-agent:
- Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML,
like Gecko) Chrome/120.0.0.0 Safari/537.36
method: HEAD
uri: https://ctt.ec/5kum7+
response:
body:
string: ''
headers:
Connection:
- keep-alive
Content-Length:
- '193'
Content-Type:
- text/html
Date:
- Wed, 31 Jan 2024 04:50:01 GMT
Location:
- https://clicktotweet.com/5kum7+
Server:
- nginx/1.4.6 (Ubuntu)
status:
code: 301
message: Moved Permanently
- request:
body: null
headers:
Connection:
- keep-alive
accept:
- text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
accept-encoding:
- gzip, deflate, br
accept-language:
- en-US,en;q=0.9
sec-fetch-dest:
- document
sec-fetch-mode:
- navigate
sec-fetch-site:
- same-origin
sec-fetch-user:
- ?1
upgrade-insecure-requests:
- '1'
user-agent:
- Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML,
like Gecko) Chrome/120.0.0.0 Safari/537.36
method: HEAD
uri: https://clicktotweet.com/5kum7+
response:
body:
string: ''
headers:
Cache-Control:
- no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection:
- keep-alive
Content-Type:
- text/html
Date:
- Wed, 31 Jan 2024 04:50:01 GMT
Expires:
- Thu, 19 Nov 1981 08:52:00 GMT
Location:
- http://
Pragma:
- no-cache
Server:
- nginx/1.4.6 (Ubuntu)
Set-Cookie:
- PHPSESSID=cnvb41rlbi9f7u1l92fu3abio0; path=/
X-Powered-By:
- PHP/5.5.9-1ubuntu4.29
status:
code: 302
message: Found
version: 1

0 comments on commit fe99db3

Please sign in to comment.