Use WHATWG URL to format the URL for the cache key
sindresorhus opened this issue · 3 comments
sindresorhus commented
jstewmon commented
@lukechilds I've tried to thoroughly explain the problem in sindresorhus/got#519 (comment).
I think cacheable-request intends to support the same interface as http.request
based on the docs:
Request function to wrap with cache support. Should be http.request or a similar API compatible request function.
So, I'd like to fix this by formatting the cache key according to one of the supported argument types for http.request
: string
, URL
or object
.
We can still check for the cache-specific options as properties on a URL instance, but I'm not sure anyone would ever want to provide them that way. I'll work up a PR.
sindresorhus commented
Yup