In accept() function you guys have this check:
|
if (substr(type, 1, 1) == ".") { |
|
type <- mime::guess_type(type, empty = NULL) |
|
} |
I am using this function to specify the file type to be accepted using the file extension only, for example:
httr::accept(".html")
#> Error in `type[file == ""] <- empty`:
#> ! replacement has length zero
#> Show Traceback
What was the idea when you made this if() statement? Did you guys intend to
- check that only extension is provided OR
- detect the hidden files (files, that start their name with a
.)?
I think the function should be more clear about its intent. So far your code is checking for hidden files and not the extensions.
In
accept()function you guys have this check:httr/R/headers.r
Lines 98 to 100 in 34b9565
I am using this function to specify the file type to be accepted using the file extension only, for example:
What was the idea when you made this
if()statement? Did you guys intend to.)?I think the function should be more clear about its intent. So far your code is checking for hidden files and not the extensions.