Skip to content

Conversation

@FranciscoKurpiel
Copy link
Collaborator

CloudFlare has broken API compatibility by changing the error status codes returned for some cases. This broke some tests on the library.

Since this library exposes the original status code, users of the library are recommended to check code that uses them against the CloudFlare documentation, to look for changes.

This is the list of changes returned from CloudFlare that affect test code on this library:

  1. When an A (IPv4 address) record is being created, if it already exists the API used to produce error code 81057. Now it returns code 81058.
  2. When an A DNS record is being created, but the content is not a valid IPv4 address, the response code used to be CF error 1004: DNS Validation Error. Now it is 9005: Content for A record must be a valid IPv4 address..

CloudFlare has broken API compatibility by changing the error status
codes returned for some cases. This broke some tests on the library.

Since this library exposes the original status code, users of the
library are recommended to check code that uses them against the
CloudFlare documentation, to look for changes.

Affected cases on this library:

1. When an "A" (IPv4 address) record is being created, if it already
   exists the API used to produce error code 81057. Now it returns code
   81058.
2. When an "A" DNS record is being created, but the content is not a
   valid IPv4 address, the response code used to be CF error "1004: DNS
   Validation Error". Now it is "9005: Content for A record must be a
   valid IPv4 address."
@FranciscoKurpiel FranciscoKurpiel self-assigned this Nov 6, 2024
@FranciscoKurpiel FranciscoKurpiel marked this pull request as ready for review November 6, 2024 20:25
@FranciscoKurpiel FranciscoKurpiel requested a review from fho as a code owner November 6, 2024 20:25
@FranciscoKurpiel FranciscoKurpiel enabled auto-merge (squash) November 6, 2024 20:25
@FranciscoKurpiel FranciscoKurpiel changed the title tests: cloudflare changed status code, breaking some tests tests: adapt tests to pass, after breaking changes made by CloudFlare Nov 6, 2024
@FranciscoKurpiel FranciscoKurpiel merged commit c472914 into master Nov 7, 2024
@FranciscoKurpiel FranciscoKurpiel deleted the fix-cf-broke-error-codes branch November 7, 2024 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants