autopkg / moofit-recipes

10 stars 27 forks source link

Fix Download issue for MirrorOp #126

Closed MLBZ521 closed 3 months ago

MLBZ521 commented 1 year ago

The download issue is simply caused by this request header being included:

<key>Accept-Encoding</key>
<string>gzip, deflate, br</string>

That said, none of the recently added request headers seem to be required. I've left them, just in case, but commented them out as it wasn't stated why they were added.

The issue described in 0f7bd7f is caused by the web server not accepting, or allowing, the etag If-None-Match and last modified If-Modified-Since checks. If these are not included, then the web server will not return a 400. Not quite sure why they're not supporting this as it literally should be saving them bandwidth... Anyways, even if you set CHECK_FILESIZE_ONLY as True in the URLDownloader step, the parent class URLGetter still adds the etag and last modified headers to the curl command. I'm not sure if this was an oversight or by design, but as far as I know, it hasn't affected anything else for all these years... I'll probably submit a PR to the autopkg repo and see what they think. If accepted, the FriendlyPathDeleter step could then be removed. And then the CHECK_FILESIZE_ONLY option will actually work as intended.

Speaking of the FriendlyPathDeleter step, I also dialed back the heavy handed "sledgehammer" option and instead of deleting the entire directory, simply deleting the .dmg file itself as this is all that's actually required. So, this will at least allow history and created .pkgs to remain and those at least won't have to be re-created when they already exist.

Finally I greatly simplified the .pkg recipe.

MLBZ521 commented 1 year ago

This should resolve #125.

MLBZ521 commented 1 year ago

@JDUBZzz @davidacland Just bumping and tagging for visibility. Thanks

MLBZ521 commented 4 months ago

@JDUBZzz @davidacland Just bumping and tagging again for visibility. Could this be reviewed and merged?

Thanks

MLBZ521 commented 2 months ago

Thanks @JDUBZzz!