[ ] ๐ Documentation (updates to the documentation, readme, or JSdoc annotations)
[ ] ๐ Bug fix (a non-breaking change that fixes an issue)
[x] ๐ Enhancement (improving an existing functionality like performance)
[ ] โจ New feature (a non-breaking change that adds functionality)
[ ] ๐งน Chore (updates to the build process or auxiliary tools and libraries)
[ ] โ ๏ธ Breaking change (fix or feature that would cause existing functionality to change)
๐ Description
This PR adds support for input to using http:// or https:// protocols.
If the path ends with .json or a response content type with HEAD method is application/jsonor text/plain for the sake of GH raw content (reverted in 194581812008c107b80f359b57bbf36c5e8a66c6), we download JSON as Template info.
Otherwise we try to guess name from URL's last segment (basename) or content-dispositionfilename header if provided in HEAD response as default name.
The fragment support as proposed in initial issue is not implemented as I think with JSON support now we have enough power to control responses without making inputs more complex but PR welcome if there are valid cases for it.
๐ Linked issue
resolves #10
previous works #86, #91 โค๏ธ
โ Type of change
๐ Description
This PR adds support for input to using
http://
orhttps://
protocols.If the path ends with
.json
or a response content type withHEAD
method isapplication/json
or(reverted in 194581812008c107b80f359b57bbf36c5e8a66c6), we download JSON as Template info.text/plain
for the sake of GH raw contentOtherwise we try to guess name from URL's last segment (basename) or
content-disposition
filename
header if provided inHEAD
response as default name.The fragment support as proposed in initial issue is not implemented as I think with JSON support now we have enough power to control responses without making inputs more complex but PR welcome if there are valid cases for it.
๐ Checklist