Skip to content

feat(HttpStatusCode): add missing 520 status code - #11067

Merged
jasonsaayman merged 1 commit into
axios:v1.xfrom
akahoshi1421:add/status-code-520
Jul 15, 2026
Merged

jasonsaayman merged 1 commit into
axios:v1.xfrom
akahoshi1421:add/status-code-520

Conversation

@akahoshi1421

@akahoshi1421 akahoshi1421 commented Jul 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

In axios, Cloudflare HTTP status codes 521–526 are present in HttpStatusCode, but 520(another Cloudflare HTTP status code) is missing.

Linked issue

N/A

Changes

Checklist

  • Tests added or updated
    • N/A: Added constant only, with no behavior change.
  • Docs/types updated if public API changed (index.d.ts and index.d.cts)
  • No breaking changes (or called out explicitly above)

Summary by cubic

Adds the missing Cloudflare 520 status to HttpStatusCode and updates type declarations. Includes unit and type tests to verify the two-way mapping.

Description

  • Summary of changes

    • Added WebServerReturnsAnUnknownError = 520 to lib/helpers/HttpStatusCode.js, index.d.ts, and index.d.cts.
    • Updated ESM/CJS added-types tests to reference the new enum member.
    • Added a unit test to assert forward and reverse mapping for 520.
  • Reasoning

    • 520 was missing while 521–526 were present.
    • Name follows Cloudflare docs for consistency.
  • Additional context

    • No behavior changes; additive constant only.

Docs

Please update the /docs/ status code reference to include HttpStatusCode.WebServerReturnsAnUnknownError (520) in the Cloudflare 5xx list.

Testing

  • Added a unit test to confirm WebServerReturnsAnUnknownError === 520 and reverse lookup.
  • Updated ESM and CJS type tests to include the new enum member.
  • No further tests needed.

Semantic version impact

Patch: additive enum value with no breaking changes.

Written for commit 1020373. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@jasonsaayman jasonsaayman added the commit::feat The PR is related to a feature label Jul 15, 2026
@jasonsaayman
jasonsaayman force-pushed the add/status-code-520 branch from a8cd534 to 1020373 Compare July 15, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commit::feat The PR is related to a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants