fix: 1341 mdb 2126 doesnt download even though its a zip file #1359
+158
−3
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.
Summary:
Closes #1341
3 shell scripts that inspect if the producer url is returning a valid zip:
headers_verifier.sh inspects what the server actually returns.
/tmp/stm.zip: HTML document text, Unicode text, UTF-8 text, with very long lines (459)
00000000 3c 21 44 4f 43 54 59 50 45 20 68 74 6d 6c 3e 0a |.|
00000010 3c 68 74 6d 6c 3e 0a 20 20 3c 68 65 61 64 3e 0a |. .|
00000020 20 20 20 20 3c 6d 65 74 61 20 68 74 74 70 2d 65 | <meta http-e|
00000030 71 75 69 76 3d 22 43 6f 6e 74 65 6e 74 2d 54 79 |quiv="Content-Ty|
00000040 70 65 22 20 63 6f 6e 74 65 6e 74 3d 22 74 65 78 |pe" content="tex|
00000050 74 2f 68 74 6d 6c 3b 20 63 68 61 72 73 65 74 3d |t/html; charset=|
00000060 55 54 46 2d 38 22 3e 0a 20 20 3c 2f 68 65 61 64 |UTF-8">. </head|
00000070 3e 0a 20 20 3c 62 6f 64 79 20 73 74 79 6c 65 3d |>. <body style=|
00000080 22 20 20 20 20 20 6d 61 72 67 69 6e 2d 6c 65 66 |" margin-lef|
00000090 74 3a 20 31 35 25 3b 20 20 6d 61 72 67 69 6e 2d |t: 15%; margin-|
HTML_headers_verifier.sh
Valid ZIP should begin with “PK..” (hex 50 4b 03 04 or 50 4b 05 06)
= Size ==
3584 /tmp/stm.zip
== First 64 bytes ==
00000000 3c 21 44 4f 43 54 59 50 45 20 68 74 6d 6c 3e 0a |.|
00000010 3c 68 74 6d 6c 3e 0a 20 20 3c 68 65 61 64 3e 0a |. .|
00000020 20 20 20 20 3c 6d 65 74 61 20 68 74 74 70 2d 65 | <meta http-e|
00000030 71 75 69 76 3d 22 43 6f 6e 74 65 6e 74 2d 54 79 |quiv="Content-Ty|
We expect that Content-Type is application/zip, but it returns a HTML indicating a page.
Expected behavior:
Explain and/or show screenshots for how you expect the pull request to work in your testing (in case other devices exhibit different behavior).
Testing tips:
Provide tips, procedures and sample files on how to test the feature.
Testers are invited to follow the tips AND to try anything they deem relevant outside the bounds of the testing tips.
Please make sure these boxes are checked before submitting your pull request - thanks!
./scripts/api-tests.shto make sure you didn't break anything