make context accessible

This commit is contained in:
Carlosokumu 2025-01-04 12:02:45 +03:00
parent d950b10b50
commit d5a2680500
Signed by: carlos
GPG Key ID: 7BD6BC8160A5C953
2 changed files with 4 additions and 4 deletions

View File

@ -15,10 +15,10 @@ import (
"git.defalsify.org/vise.git/logging"
"git.defalsify.org/vise.git/resource"
"git.grassecon.net/urdt/ussd/common"
"git.grassecon.net/urdt/ussd/config"
"git.grassecon.net/urdt/ussd/initializers"
"git.grassecon.net/urdt/ussd/internal/handlers"
"git.grassecon.net/urdt/ussd/internal/http/at"
httpserver "git.grassecon.net/urdt/ussd/internal/http/at"
"git.grassecon.net/urdt/ussd/internal/storage"
"git.grassecon.net/urdt/ussd/remote"
@ -122,7 +122,7 @@ func main() {
defer stateStore.Close()
rp := &at.ATRequestParser{
context: ctx,
Context: ctx,
}
bsh := handlers.NewBaseSessionHandler(cfg, rs, stateStore, userdataStore, rp, hl)
sh := httpserver.NewATSessionHandler(bsh)

View File

@ -15,7 +15,7 @@ import (
)
type ATRequestParser struct {
context context.Context
Context context.Context
}
func (arp *ATRequestParser) GetSessionId(rq any) (string, error) {
@ -43,7 +43,7 @@ func (arp *ATRequestParser) GetSessionId(rq any) (string, error) {
decodedStr := string(logBytes)
sessionId, err := extractATSessionId(decodedStr)
if err != nil {
context.WithValue(arp.context, "at-session-id", sessionId)
context.WithValue(arp.Context, "at-session-id", sessionId)
}
logg.Debugf("Received request:", decodedStr)
}