Skip to content

Instantly share code, notes, and snippets.

@onion2k
Created July 26, 2023 10:54
Show Gist options
  • Select an option

  • Save onion2k/595f77aad6e6d4abb02cd59fb605ffc6 to your computer and use it in GitHub Desktop.

Select an option

Save onion2k/595f77aad6e6d4abb02cd59fb605ffc6 to your computer and use it in GitHub Desktop.
const resHeaders = Object.prototype.hasOwnProperty.call(res, 'headers')
? res.headers.all()
: Object.fromEntries(res.headers.entries());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment