Skip to content

Conversation

Shnatsel
Copy link
Member

Part of #750

Not actually wired up to cargo audit yet, just shows what the approach might look like

const ADVISORY_DB_DIRECTORY: &str = "advisory-db";

/// The default URL from which the DB is downloaded
const DEFAULT_DB_URL: &str = "https://github.com/zip-rs/zip/archive/refs/heads/master.zip";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems bogus in multiple ways... just for testing I guess?

FWIW the tarball seems a lot smaller:

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh there's a .tar.gz? Nice, I'll use that instead!

I already have the streaming .tar.gz extraction code too, so no need for even the cursor.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anything else I should fix here other than switching from .zip to .tar.gz?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good so far otherwise. Hopefully etags work for those resources.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well they do provide an etag in the response, so the worst case is we don't rely on the 304 and instead check the etag in the response headers and stop there. So no worries there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants