Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix corporatedomains whois created/expires on format #122

Closed

Conversation

njng
Copy link

@njng njng commented Jun 21, 2019

Some of the responses return the creation/expiration date in a format that is parsed incorrectly through parse_time. This occurs specifically for corporatedomains in some instances where the date format is returned as "MM/DD/YYYY", but is interpreted as "DD/MM/YYYY" so these dates need to be parsed separately.

itghlu and others added 4 commits April 4, 2019 14:40
Fix date parsing in AFNIC parsers as the format had changed from
DD/MM/YYYY to YYYY-MM-DDThh:mm:ssZ.
Updated the WHOIS parser for corporatedomains which were incorrectly
parsing "Registrar Registration Expiration Date", because the date had
"MM/DD/YYYY" format rather than "DD/MM/YYYY". The change updates
the format if the value has slash-separated date before passing it into
`parse_time`. This change cannot be used for all dates, since some dates
use a dash-separated format (i.e. YYYY-MM-DDTHH:MM:SSZ).

This problem also applies to the creation date as well when parsing the
value for "Creation Date".
Moved the existing `status_available` files into the `com` folder where
the new `status_registered` files will be generated. Generated new
`status_registered` files for the different cases when the
creation and expiration dates are hyphen-separated vs slash-separated.

Also re-used the existing `.expected` file from the old
`status_registered` file to test for the new values.
Return the result from `Time.utc` to parse dates using slash-format in
corporatedomains, since this would avoid using joins and string
interpolation before being passed into `parse_time`.

Renamed the method as the return value now returns a Time object rather
than a string.
@njng njng changed the title Fix corporatedomains whois expires on format Fix corporatedomains whois created/expires on format Jun 21, 2019
Copy link
Owner

@weppos weppos left a comment

Choose a reason for hiding this comment

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

It looks like this PR contains several other changes, not just the corporatedomains fix. Can you please remove the non-related changes.

@njng
Copy link
Author

njng commented Jun 25, 2019

Since it was branched from another branch, I created a new PR which only contains those changes: #123

@njng njng closed this Jun 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants