Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

httr::parse_url not parsing AWS s3 uri correctly #659

Closed
DyfanJones opened this issue Jul 8, 2020 · 1 comment
Closed

httr::parse_url not parsing AWS s3 uri correctly #659

DyfanJones opened this issue Jul 8, 2020 · 1 comment

Comments

@DyfanJones
Copy link

Hi all,

When working with AWS S3 uri format I have noticed that httr::parse_url isn't parsing it as expected. A standard s3 uri follows the following format: s3://mybucket/path/to/file. When parsed I expect it to be:

# $scheme
# s3
# 
# $hostname
# mybucket
# 
# $hostname
# NULL
#
# $path
# path/to/file
# 

However I get the following

s3_uri = "s3://mybucket/path/to/file"

(parsed1 = httr::parse_url(s3_uri))
# $scheme
# NULL
# 
# $hostname
# NULL
# 
# $port
# NULL
# 
# $path
# [1] "s3://mybucket/path/to/file"
# 
# $query
# NULL
# 
# $params
# NULL
# 
# $fragment
# NULL
# 
# $username
# NULL
# 
# $password
# NULL
# 
# attr(,"class")
# [1] "url"

When using the urltools::url_parse

parsed2 = urltools::url_parse(s3_uri)
# scheme   domain   port         path          parameter fragment
# s3       mybucket <NA>         path/to/file      <NA>     <NA>

Similar with python's urllib:

import urllib

s3_uri = "s3://mybucket/path/to/file"

urllib.parse.urlparse(s3_uri)
>>> ParseResult(scheme='s3', netloc='mybucket', path='/path/to/file', params='', query='', fragment='')
@DyfanJones DyfanJones changed the title httr::parse_url not parsing s3 uri correctly httr::parse_url not parsing AWS s3 uri correctly Jul 8, 2020
@hadley
Copy link
Member

hadley commented Oct 31, 2023

httr has been superseded in favour of httr2, so is no longer under active development. If this problem is still important to you in httr2, I'd suggest filing an issue offer there 😄. Thanks for using httr!

@hadley hadley closed this as completed Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants