Skip to content
New issue

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

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

Already on GitHub? # to your account

Improve http_status validation #1390

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kurochan
Copy link

@kurochan kurochan commented Jan 6, 2025

Currently, the validation of the http status input is a numeric range, so an invalid status code can be entered. Change to check if the http status code exists or not.
related to #1389 .

2024-12-24-11 09 30@2x

Even if this validation were added, it is still possible to set it from the Web UI( https://one.dash.cloudflare.com/ ), so that needs to be modified as well.

Those that exist as http status but are not normally used can be registered, but I think this should be handled by the web UI.
(Personally, I don't see a problem with using the joke status code because it's funny.)
image(1)
2024-12-24-11 03 22

@lazysegtree
Copy link

@kurochan, this apparently creates a dependency about http status codes on the go source code.

Also there are some "Unofficial codes" that might be a valid use case (See https://en.wikipedia.org/wiki/List_of_HTTP_status_codes), for which go's StatusText function would not return any text.

  • For example HTTP 218, 509, 529, and many more

(Here is a screenshot from wiki page about the additional unofficial codes, used by cloudflare too)
image

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

Successfully merging this pull request may close these issues.

2 participants