jacktuck / unfurl

Metadata scraper with support for oEmbed, Twitter Cards and Open Graph Protocol for Node.js :zap:
MIT License
474 stars 51 forks source link

Allow passing extra headers to fetch request #89

Closed wereHamster closed 2 years ago

wereHamster commented 2 years ago

Use case: include cookies or authorization header.

jacktuck commented 2 years ago

Hi @wereHamster I think previous versions allowed this but I must have removed by accident. Would you like to make a PR?

wereHamster commented 2 years ago

How about allowing the user to pass the whole RequestInit (https://fetch.spec.whatwg.org/#requestinit) via options? Or even a completely custom fetch implementation?