LinkFinder icon indicating copy to clipboard operation
LinkFinder copied to clipboard

How to prepend domain name before the relative url.

Open jaikishantulswani opened this issue 4 years ago • 5 comments

@GerbenJavado @EdOverflow Is there any workaround to append domain name before the relative url's like full url ?

jaikishantulswani avatar Oct 21 '19 05:10 jaikishantulswani

You can pipe the output into sed.

$ python linkfinder.py -i https://example.com/example.js -o cli | sed 's#^\/#https://example.com/#g'

EdOverflow avatar Oct 21 '19 12:10 EdOverflow

Hi @EdOverflow thank you for your reply. Here as per your solution only the parent domain is appended to all the relative urls. But I have some scenario where I use -d flag and linkfinder found some more sub domains and their relative url's too, so how we append them ? Example: python linkfinder.py -i https://example.com -d -o cli /test /test1 /test2 https://new.example.com /demo1 /demo2

So in the above scenario there is one more subdomain and their relative url's found so how we append https://new.example.com too.

Regards, @jaikishantulswani

jaikishantulswani avatar Oct 22 '19 05:10 jaikishantulswani

Hi @EdOverflow any workaround for this ?

jaikishantulswani avatar Oct 26 '19 05:10 jaikishantulswani

Hi @EdOverflow any workaround for this ?

jaikishantulswani avatar Nov 08 '19 13:11 jaikishantulswani

@jaikishantulswani, as far as I can tell this might be too difficult to solve as is because it is not always clear which host the JS file belongs to. In your example, there is no guarantee that /demo2 belongs to https://new.example.com, so you might end up with a lot of false-positives.

I am open to suggestions though. Maybe someone out there knows of a potential solution for this problem.

EdOverflow avatar Nov 08 '19 13:11 EdOverflow