Code Monkey home page Code Monkey logo

Comments (2)

shabble avatar shabble commented on June 12, 2024

The problem is that I'm just taking the last Location: header in the chain, and hoping it's good enough. I guess the proper way to do things is to dig down into LWP::UA and use $ua->simple_request and manually follow the redirect chain.

I'm not sure if it's necessarily a bug that an intermediate step in that chain doesn't match the whitelist, unless you can think of a reason why it should? For example, with your t.co link, we have:

  1. http://t.co/AgHfYlq -> http://www.faz.net/-025ATJ
  2. http://www.faz.net/-025ATJ -> http://www.faz.net//artikel/C31315/ueberwachung-wir-leben-noch-frei-aber-nicht-mehr-lange-30685243.html

Should the output here be the -025SATJ url, or the terminal redirection?

Part of resolving this should solve the 2nd part, of making sure URLs get canonicalised as well.

from irssi-scripts.

duckdalbe avatar duckdalbe commented on June 12, 2024

Personally I'd prefer the output of longify-urls to be
http://www.faz.net/-025ATJ.

But the real issue is the missing hostnames (2nd part). If you feel you
can solve the canonicalization more easily without stepping through the
redirect chain I'd be way happier than today, too!

from irssi-scripts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.