mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 06:05:58 -06:00
[PR #195] [MERGED] Core: Added all well known http status codes #224
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/ultimatepp#224
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/ultimatepp/ultimatepp/pull/195
Author: @klugier
Created: 4/7/2024
Status: ✅ Merged
Merged: 4/8/2024
Merged by: @mirek-fidler
Base:
master← Head:klugier/http-status-codes📝 Commits (5)
e65b451Core: Added all available http status codesd12930aMerge branch 'master' of https://github.com/ultimatepp/ultimatepp into klugier/http-status-codes97f5cbfModernized to Mirek's approch3385518Remove HttpStatus.h77d38a4.fix📊 Changes
6 files changed (+98 additions, -7 deletions)
View changed files
📝
tutorial/Network02/Network02.cpp(+8 -5)📝
uppsrc/Core/Core.upp(+1 -0)📝
uppsrc/Core/Http.cpp(+10 -0)➕
uppsrc/Core/HttpStatusCode.i(+67 -0)📝
uppsrc/Core/Inet.h(+10 -1)📝
uppsrc/Core/InetUtil.cpp(+2 -1)📄 Description
I decided to add all well knowned http status code to Core. The main reason for that is to do not use magic numbers and magic strings and having everything under well defined constants.
Status codes are basing on ints, so they are a good fit for the current code base.
This change also introduces HttpStatusLine for simplifying HttpResponse calls with status codes. In the future HttpResponse function will need to be replaced. One of the reason to do it is that it will be almost impossible to implement HTTP 2.0 protocol (Break api changes required).
The implementation is similar to http implementation in GoLang (https://go.dev/src/net/http/status.go).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.