- 23 7月, 2019 1 次提交
-
-
由 Rafael França 提交于
Fix host for ActiveStorage DiskService
-
- 21 12月, 2018 1 次提交
-
-
由 Ryuta Kamizono 提交于
Currently we sometimes find a redundant begin block in code review (e.g. https://github.com/rails/rails/pull/33604#discussion_r209784205). I'd like to enable `Style/RedundantBegin` cop to avoid that, since rescue/else/ensure are allowed inside do/end blocks in Ruby 2.5 (https://bugs.ruby-lang.org/issues/12906), so we'd probably meets with that situation than before.
-
- 28 11月, 2018 1 次提交
-
-
由 Rosa Gutierrez 提交于
* Force content-type to binary on service urls for relevant content types We have a list of content types that must be forcibly served as binary, but in practice this only means to serve them as attachment always. We should also set the Content-Type to the configured binary type. As a bonus: add text/cache-manifest to the list of content types to be served as binary by default. * Store content-disposition and content-type in GCS Forcing these in the service_url when serving the file works fine for S3 and Azure, since these services include params in the signature. However, GCS specifically excludes response-content-disposition and response-content-type from the signature, which means an attacker can modify these and have files that should be served as text/plain attachments served as inline HTML for example. This makes our attempt to force specific files to be served as binary and as attachment can be easily bypassed. The only way this can be forced in GCS is by storing content-disposition and content-type in the object metadata. * Update GCS object metadata after identifying blob In some cases we create the blob and upload the data before identifying the content-type, which means we can't store that in GCS right when uploading. In these, after creating the attachment, we enqueue a job to identify the blob, and set the content-type. In other cases, files are uploaded to the storage service via direct upload link. We create the blob before the direct upload, which happens independently from the blob creation itself. We then mark the blob as identified, but we have already the content-type we need without having put it in the service. In these two cases, then, we need to update the metadata in the GCS service. * Include content-type and disposition in the verified key for disk service This prevents an attacker from modifying these params in the service signed URL, which is particularly important when we want to force them to have specific values for security reasons. * Allow only a list of specific content types to be served inline This is different from the content types that must be served as binary in the sense that any content type not in this list will be always served as attachment but with its original content type. Only types in this list are allowed to be served either inline or as attachment. Apart from forcing this in the service URL, for GCS we need to store the disposition in the metadata. Fix CVE-2018-16477.
-
- 22 8月, 2018 1 次提交
-
-
由 Cameron Bothner 提交于
`ActiveStorage::Blob#download` and `ActiveStorage::Blob#open` raise `ActiveStorage::FileNotFoundError` when the corresponding file is missing from the storage service. Services translate service-specific missing object exceptions (e.g. `Google::Cloud::NotFoundError` for the GCS service and `Errno::ENOENT` for the disk service) into `ActiveStorage::FileNotFoundError`.
-
- 16 7月, 2018 1 次提交
-
-
由 George Claghorn 提交于
Closes #32193.
-
- 29 4月, 2018 1 次提交
-
-
由 George Claghorn 提交于
Match other services, which all use a 5 MB chunk size.
-
- 07 4月, 2018 1 次提交
-
-
由 Andrew White 提交于
Trying to pass the current request down to the service so that it can create full urls instead of paths makes the API messy so use a model based on ActiveSupport::CurrentAttributes to provide the current host to services that need it (primarily the disk service).
-
- 06 3月, 2018 1 次提交
-
-
由 George Claghorn 提交于
Fixes #32129.
-
- 17 1月, 2018 1 次提交
-
-
由 George Claghorn 提交于
-
- 16 1月, 2018 1 次提交
-
-
由 George Claghorn 提交于
-
- 03 12月, 2017 1 次提交
-
-
由 George Claghorn 提交于
-
- 29 9月, 2017 1 次提交
-
-
由 George Claghorn 提交于
-
- 26 8月, 2017 1 次提交
-
-
由 Koichi ITO 提交于
`content_type` parameter is before `disposition` parameter.
-
- 21 8月, 2017 1 次提交
-
-
由 George Claghorn 提交于
-
- 16 8月, 2017 2 次提交
-
-
由 Koichi ITO 提交于
And enable `context_dependent` of Style/BracesAroundHashParameters cop.
-
由 Xavier Noria 提交于
-
- 12 8月, 2017 1 次提交
-
-
由 Koichi ITO 提交于
-
- 11 8月, 2017 1 次提交
-
-
由 yuuji.yaginuma 提交于
* Use `+` instead of backquote. * Remove escape from class to be link
-
- 09 8月, 2017 1 次提交
-
-
由 Yoshiyuki Hirano 提交于
-
- 05 8月, 2017 1 次提交
-
-
由 claudiob 提交于
The reasons for this commit are: - uniformity with the other Rails libraries - (possibly) behave better with respect to autoloading - fix the index in the generated documentation Before this commit, run `rake rdoc` generates this left sidebar (ActiveStorage entries are indexed twice, both inside and outside the module): <img width="308" alt="before" src="https://user-images.githubusercontent.com/10076/28939523-7c087dec-7846-11e7-9289-38ed4a2930cd.png"> After this commit, run `rake rdoc` generates this left sidebar: (ActiveStorage entries are only indexed inside the module): <img width="303" alt="after" src="https://user-images.githubusercontent.com/10076/28939524-7c090be0-7846-11e7-8ee5-29dfecae548e.png">
-
- 04 8月, 2017 2 次提交
-
-
由 Rafael Mendonça França 提交于
We are already removing the braces around hash parameters in the last argument in other places so we should not change the entire codebase because of two places.
-
由 Rafael Mendonça França 提交于
-