-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Add support for root-relative path URLs to the disk service #32139
Add support for root-relative path URLs to the disk service #32139
Conversation
We can’t do this by default. Content type identification for direct uploads requires that |
@georgeclaghorn what if we moved |
I considered that before and was loath to add to the Service API, but I suppose it’s best. The catch is that the official Google Cloud Storage client doesn’t support range downloads, so the GCS service will have to do roughly what |
If we go down that path, we can do away with the |
@pixeltrix, I took the liberty of implementing your proposal in anticipation of tomorrow’s release candidate. |
@georgeclaghorn thanks - was going to look at it at the weekend but ended up having to work. Do the docs need updating? |
UPDATE: I now realize that this makes ORIGINAL COMMENT:
I'm sure I'm missing something, but this will be problematic for any non-HTML forms (or Rails-provided JS lib) clients, no? For example, a native iOS/Android client. We have a Rails UI which uses the built in direct upload stuff. But we also have an iOS client that needs to upload files. Our iOS client first creates a {
"id": 1,
"key": "AHPU4cV8yHWYzoGfaaRuTQzg",
"filename": "some-file.png",
"content_type": "image/png",
"metadata": {},
"byte_size": 15844,
"checksum": "dHJ4QIEDJy7mxfm0IE09xw==",
"created_at": "2018-03-07T20:17:36.756Z",
"signed_id": "eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--5e5775d4c690a6a4171abb69e25e50e91f8a61cd",
"direct_upload": {
"url": "http://localhost:5000/rails/active_storage/disk/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDVG9JYTJWNVNTSWRRVWhRVlRSalZqaDVTRmRaZW05SFptRmhVblZVVVhwbkJqb0dSVlE2RVdOdmJuUmxiblJmZEhsd1pVa2lEbWx0WVdkbEwzQnVad1k3QmxRNkUyTnZiblJsYm5SZmJHVnVaM1JvYVFMa1BUb05ZMmhsWTJ0emRXMUpJaDFrU0VvMFVVbEZSRXA1TjIxNFptMHdTVVV3T1hoM1BUMEdPd1pVIiwiZXhwIjoiMjAxOC0wMy0wN1QyMDoyMjozNi43ODBaIiwicHVyIjoiYmxvYl90b2tlbiJ9fQ==--c639a4499a4159ae7c6d3abcf4ce8a89b23ba964",
"headers": {
"Content-Type": "image/png"
}
}
} The client then pulls out the Am I understanding this correctly? |
Also caches the url helpers module since that was being created every time an Active Storage url was generated.