
d_run
2019-1-15 22:32:03
Question about get-pure-port/headers
and redirects. Currently with this test code:
#lang racket
(require net/url-structs
net/url)
(define-values (body header)
(get-pure-port/headers
(string->url "<https://t.co/3Xp6QzPqI3>")
#:status? #t #:redirections 20))
(displayln header)
(displayln (port->string body))
The #:redirections
is set to 20
but all I get back is:
HTTP/1.1 301 Moved Permanently
cache-control: private,max-age=300
content-length: 0
date: Tue, 15 Jan 2019 22:29:12 GMT
expires: Tue, 15 Jan 2019 22:34:12 GMT
location: <http://blog.robic.me>
server: tsa_b
set-cookie: muc=fef1dfb0-3fb3-4c05-9558-5bf4891b6fec; Max-Age=63072000; Expires=Thu, 14 Jan 2021 22:29:12 GMT; Domain=<http://t.co\|t.co>
strict-transport-security: max-age=0
vary: Origin
x-connection-hash: dce864e4ab2808ba233ef1a00ed80628
x-response-time: 16
I thought it would follow the 301

d_run
2019-1-15 22:32:21
or does it only follow 302
?

d_run
2019-1-15 22:48:01
yeah it def works with a 302
using "<https://httpbin.org/absolute-redirect/10>"

d_run
2019-1-15 22:53:51
could it be because its going from https
to http
?