Skip to content

Only redirect skapps

Ivaylo Novakov requested to merge ivo/only_redirect_skapps into master

MERGE REQUEST

MR Guidelines

Overview

When a user requests a skylink without a trailing slash we redirect them to the same skylink with a trailing slash. This is done in order to make sure that skapps can request subfile via relative paths. But we don't need to do it for non-skapp skyfiles. This MR limits the redirects to skapps.

Additionally, when we redirect, we accidentally drop all query parameters passed in the original request. This is obviously a problem and this MR also solves that by explicitly re-adding all query parameters before returning the redirect header.

It would be nice to add tests for these changes. This would be easier and cleaner after !4687 (merged) is merged and I will leave it as F/U for that moment.

Example for Visual Changes

Checklist

Review and complete the checklist to ensure that the MR is complete before assigned to an approver.

  • [ ] All new methods or updated methods have clear docstrings
  • [ ] Testing added or updated for new methods
  • [ ] Any new packages are added to Makefile and .gitlab-ci.yml
  • [ ] API documentation updated for API updates
  • [ ] Module README.md updated for changes to workflow
  • [ ] Issue added to Sia-UI repo for new supporting features
  • [ ] Changelog File Created

Issues Closed

Merge request reports