feat: Patch rnfs to handle 303 http code on download - #638
Merged
Conversation
Ldoppea
suggested changes
Mar 5, 2023
Contributor
There was a problem hiding this comment.
Your patch contains way too many lines, it should contains only something like:
--- a/node_modules/react-native-fs/android/src/main/java/com/rnfs/Downloader.java
+++ b/node_modules/react-native-fs/android/src/main/java/com/rnfs/Downloader.java
@@ -67,6 +67,7 @@ public class Downloader extends AsyncTask<DownloadParams, long[], DownloadResult
(
statusCode == HttpURLConnection.HTTP_MOVED_PERM ||
statusCode == HttpURLConnection.HTTP_MOVED_TEMP ||
+ statusCode == HttpURLConnection.HTTP_SEE_OTHER ||
statusCode == 307 ||
statusCode == 308
)It seems like your node_modules were not up-to-date when you run the patch command.
If you do a yarn install and run the patch command again it should generate the correct diff file.
doubleface
force-pushed
the
feat/rnfs303patch
branch
from
March 6, 2023 08:42
c098147 to
f9b18f4
Compare
Contributor
Author
|
@Ldoppea I generated it with patch-package. Now I modified it manually to only let what is wanted |
doubleface
force-pushed
the
feat/rnfs303patch
branch
from
March 6, 2023 09:55
f9b18f4 to
431ca32
Compare
doubleface
force-pushed
the
feat/rnfs303patch
branch
from
March 6, 2023 10:16
431ca32 to
088c9dc
Compare
Contributor
Author
|
@Ldoppea Now the current patch is generated after a And this output the correct patch |
Ldoppea
approved these changes
Mar 6, 2023
Contributor
|
Nice :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch will handle 303 response on download when using the local stack with a http url and not https.
An issue has been created on the react-native-fs : itinance/react-native-fs#1153
Checklist
Before merging this PR, the following things must have been done: