mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
[PR #1440] [MERGED] fix: status code detection #3314
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#3314
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hoppscotch/hoppscotch/pull/1440
Author: @dunglas
Created: 1/24/2021
Status: ✅ Merged
Merged: 1/25/2021
Merged by: @liyasthomas
Base:
main← Head:fix/status-detection📝 Commits (2)
d76a1f2fix: status code detectionad331b6Merge branch 'main' into fix/status-detection📊 Changes
1 file changed (+35 additions, -34 deletions)
View changed files
📝
helpers/findStatusGroup.js(+35 -34)📄 Description
The current regular expressions detecting status code classes are incorrect. For instance
422(which is returned by Rails, Symfony and API Platform when a request is invalid because of invalid user data) is detected as belonging to thesuccessclass instead ofclient errorbecause it contains the number2.The regex should be something like
/^4\d{2}$/but using a RegExp here isn't necessary, so I switched to simple numerical comparisons (which are faster).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.