mirror of
https://github.com/pocketbase/pocketbase.git
synced 2025-01-06 00:18:50 +02:00
[#1956] normalized _requests.method to UPPERCASE
This commit is contained in:
parent
41f01bab0d
commit
07727dbde6
@ -1,3 +1,8 @@
|
||||
## (WIP) v0.14.0
|
||||
|
||||
- Normalized the request logs `method` value to UPPERCASE, eg. "get" => "GET" ([#1956](https://github.com/pocketbase/pocketbase/discussions/1956)).
|
||||
|
||||
|
||||
## v0.13.0
|
||||
|
||||
- Added new "View" collection type allowing you to create a read-only collection from a custom SQL `SELECT` statement. It supports:
|
||||
|
@ -321,7 +321,7 @@ func ActivityLogger(app core.App) echo.MiddlewareFunc {
|
||||
|
||||
model := &models.Request{
|
||||
Url: httpRequest.URL.RequestURI(),
|
||||
Method: strings.ToLower(httpRequest.Method),
|
||||
Method: strings.ToUpper(httpRequest.Method),
|
||||
Status: status,
|
||||
Auth: requestAuth,
|
||||
UserIp: realUserIp(httpRequest, ip),
|
||||
|
18
migrations/logs/1677760279_uppsercase_method.go
Normal file
18
migrations/logs/1677760279_uppsercase_method.go
Normal file
@ -0,0 +1,18 @@
|
||||
package logs
|
||||
|
||||
import (
|
||||
"github.com/pocketbase/dbx"
|
||||
)
|
||||
|
||||
// This migrations converts all logs "method" valus to all UPPERCASE (eg. "get" => "GET").
|
||||
func init() {
|
||||
LogsMigrations.Register(func(db dbx.Builder) error {
|
||||
_, err := db.NewQuery("UPDATE {{_requests}} SET method=UPPER(method)").Execute()
|
||||
|
||||
return err
|
||||
}, func(db dbx.Builder) error {
|
||||
_, err := db.NewQuery("UPDATE {{_requests}} SET method=LOWER(method)").Execute()
|
||||
|
||||
return err
|
||||
})
|
||||
}
|
Loading…
Reference in New Issue
Block a user