Skip to content

Medium links do not follow redirect #43

@peterfriese

Description

@peterfriese

When trying to parse OG meta data from Medium articles shared from within their iOS app, OpenGraph returns an empty result.

URLs shared form their app look like this: https://link.medium.com/oT1YJfn1G9

Retrieving this URL with curl resolves to the final URL (https://onezero.medium.com/i-bought-a-new-router-it-told-me-i-was-hacked-fb141930dd22?source=userActivityShare-ea0b1eb1f5d2-1599825776&_branch_match_id=link-832936551787943816)

curl -v https://link.medium.com/oT1YJfn1G9
*   Trying 52.8.138.103...
* TCP_NODELAY set
* Connected to link.medium.com (52.8.138.103) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/cert.pem
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use http/1.1
* Server certificate:
*  subject: CN=link.medium.com
*  start date: Aug 22 09:07:22 2020 GMT
*  expire date: Nov 20 09:07:22 2020 GMT
*  subjectAltName: host "link.medium.com" matched cert's "link.medium.com"
*  issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
*  SSL certificate verify ok.
> GET /oT1YJfn1G9 HTTP/1.1
> Host: link.medium.com
> User-Agent: curl/7.64.1
> Accept: */*
>
< HTTP/1.1 307 Temporary Redirect
< Server: openresty/1.13.6.2
< Date: Fri, 11 Sep 2020 12:03:58 GMT
< Content-Length: 0
< Connection: keep-alive
< X-Powered-By: Express
< Set-Cookie: _s=vulHH3zzhLh5cNMbTeZBmlRnPTWSi6J1oZt4uT835w2OYeFv9ocdeRfs7kngIVl7; Max-Age=31536000; Path=/; Expires=Sat, 11 Sep 2021 12:03:58 GMT
< Last-Modified: Fri, 11 Sep 2020 12:03:58 GMT
< Location: https://onezero.medium.com/i-bought-a-new-router-it-told-me-i-was-hacked-fb141930dd22?source=userActivityShare-ea0b1eb1f5d2-1599825776&_branch_match_id=link-832936551787943816
<
* Connection #0 to host link.medium.com left intact
* Closing connection 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions