url-metadata icon indicating copy to clipboard operation
url-metadata copied to clipboard

add customHeaders option

Open chienwen opened this issue 4 years ago • 1 comments

I suggest adding a new option customHeaders to specify any header if needed.

In my use case, a website may prompt a window at the first time to confirm my age is over 18. So in this case I can add a custom cookie in the header:

urlMetadata('https://www.ptt.cc/bbs/Gossiping/index.html', {
    customHeaders: {
        'cookie': 'over18=1'
    }
}).then( ... );

chienwen avatar Feb 04 '21 17:02 chienwen

When will this be merged?

bieblebrox avatar Apr 21 '21 12:04 bieblebrox

Custom header option available in new version 3.0.1 https://www.npmjs.com/package/url-metadata

laurengarcia avatar Apr 18 '23 19:04 laurengarcia