mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2026-05-16 08:45:18 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cb416d49c4 | ||
|
|
cb921f2c5e |
@@ -64,7 +64,10 @@ type ExpandOption struct {
|
||||
// decodeHeaderValue decodes base64 encoded header values
|
||||
// Supports ZIP_ and __ prefixes for base64 encoding
|
||||
func decodeHeaderValue(value string) string {
|
||||
str, _ := DecodeParam(value)
|
||||
str, err := DecodeParam(value)
|
||||
if err != nil {
|
||||
return value
|
||||
}
|
||||
return str
|
||||
}
|
||||
|
||||
@@ -98,6 +101,11 @@ func DecodeParam(pStr string) (string, error) {
|
||||
|
||||
if strings.HasPrefix(code, "ZIP_") || strings.HasPrefix(code, "__") {
|
||||
code, _ = DecodeParam(code)
|
||||
} else {
|
||||
strDat, err := base64.StdEncoding.DecodeString(code)
|
||||
if err == nil {
|
||||
code = string(strDat)
|
||||
}
|
||||
}
|
||||
|
||||
return code, nil
|
||||
|
||||
@@ -174,6 +174,7 @@ func (h *Handler) handleRequest(conn *Connection, msg *Message) {
|
||||
Options: msg.Options,
|
||||
ID: recordID,
|
||||
Data: msg.Data,
|
||||
Tx: h.db,
|
||||
Metadata: make(map[string]interface{}),
|
||||
}
|
||||
|
||||
|
||||
@@ -111,6 +111,9 @@ type HookContext struct {
|
||||
AbortMessage string // Message to return if aborted
|
||||
AbortCode int // HTTP status code if aborted
|
||||
|
||||
// Tx provides access to the database/transaction for executing additional SQL
|
||||
Tx common.Database
|
||||
|
||||
// Metadata is additional context data
|
||||
Metadata map[string]interface{}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user