Add support for temporary redirects 302
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 2.5k
- Forks
- 1k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 13
Description
Expected behaviour
Temporary redirects 302 are supported and not treated as permanent redirects.
Actual behaviour
Temporary redirects 302 are not supported. The app treats 302 as a permanent redirect and uses the last url (after redirects) as authoritative. However, as the redirect is temporary the last url may not be available in the future.
NCManageDatabase::getDirectoryId is always called with the URL after redirects without considering whether they are temporary or permanent.
Steps to reproduce
- Run nextcloud on port 8081
- Setup server to listen on port 8082 and send a redirect code 301 to same url but on port 8081.
- Try to login in through desktop app with port 8082.
- All fine, files are able to download, upload, etc.
- Kill app
- Remove redirection from server
- Move nextcloud to listen on port 8082
- Run app again
- It fails to download any file
iOS version
iOS 12.1
App version
Testflight version 2.22.6 (17)
Server configuration
Operating system:
Debian Linux
Web server:
Apache
Database:
default
PHP version:
default from snap
Nextcloud version: (see Nextcloud admin page)
13.0.7
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at NCManageDatabase::getDirectoryId and trace how the iOS app handles URLs after HTTP redirects. Reproduce the port-redirect sequence described in the issue, then verify that a temporary 302 is not treated as permanent and that the app still works after the redirect is removed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100