lanrat / czds

simple golang API and tools to interact with czds.icann.org
https://pkg.go.dev/github.com/lanrat/czds
GNU General Public License v3.0
72 stars 14 forks source link

Zone File Integrity #12

Closed Khalid-Nowaf closed 2 years ago

Khalid-Nowaf commented 2 years ago

While I'm downloading zone files, the com.zone sometimes get downloaded partially with no errors.

I have added one more step in my script to validate if the file gets downloaded completely by issuing the following command. $ gzip --test com.txt.gz gzip: com.txt.gz: unexpected end of file

Even if I try to run the czds-dl for a second time, I got the following logs:

[com.zone] err: unexpected EOF
downloading 'https://czds-download-api.icann.org/czds/downloads/com.zone'

It would be very handy to check the content-length after each download and log/throw/retry and delete and clean up any corrupted files if any.

this will help the user to trust the downloaded zones.

lanrat commented 2 years ago

Fixed in #13!

Thanks for the report and PR!

lanrat commented 2 years ago

Included in new version: v1.2.5.