diff options
author | Stan Hu <stanhu@gmail.com> | 2019-01-22 03:03:37 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-01-22 09:13:37 +0300 |
commit | 940ad0c7a14e7ecff34300737e5802c4956bbb23 (patch) | |
tree | e6f9c10c29e6de635e7f2fc0161f89151cf68e16 /changelogs | |
parent | c141d0afb15366beb1cae8a240faf6aaeb632214 (diff) |
Fix 404s with snippet uploads in object storage
Previously, an HTTP request for
`/uploads/-/system/personal_snippet/:snippet_id/:hash/:filename` would
look for an uploader of `PersonalFileUploader` class and use
`PersonalFileUploader#upload_paths` to search the datbase for one of the
following paths:
1. `:hash/:filename`
2. `uploads/-/system/personal_snippet/:id/:hash/:filename`
However, when the upload were stored in object storage,
`PersonalFileUploader#store_dirs` stored the path as:
`personal_snippet/:snippet_id/:hash`
The extraneous `uploads/-/system` prefix prevented the path from being
matched, and uploads in object storage would return a 404 error. Uploads
in local storage would work fine.
To fix this, we set the `#base_dir` properly so that `#upload_paths`
generates the right value for object storage. Note that this also makes
`#store_dirs` do the right thing in `FileUploader`.
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/52595
Diffstat (limited to 'changelogs')
-rw-r--r-- | changelogs/unreleased/sh-fix-snippet-uploads-path-lookup.yml | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/changelogs/unreleased/sh-fix-snippet-uploads-path-lookup.yml b/changelogs/unreleased/sh-fix-snippet-uploads-path-lookup.yml new file mode 100644 index 00000000000..414c8663049 --- /dev/null +++ b/changelogs/unreleased/sh-fix-snippet-uploads-path-lookup.yml @@ -0,0 +1,5 @@ +--- +title: Fix 404s with snippet uploads in object storage +merge_request: 24550 +author: +type: fixed |