Merge branch 'lash/purify' into lash/purify-more
This commit is contained in:
commit
418080d093
@ -18,7 +18,7 @@ import (
|
|||||||
"git.grassecon.net/urdt/ussd/config"
|
"git.grassecon.net/urdt/ussd/config"
|
||||||
"git.grassecon.net/urdt/ussd/initializers"
|
"git.grassecon.net/urdt/ussd/initializers"
|
||||||
"git.grassecon.net/urdt/ussd/internal/handlers"
|
"git.grassecon.net/urdt/ussd/internal/handlers"
|
||||||
at "git.grassecon.net/urdt/ussd/internal/http/at"
|
"git.grassecon.net/urdt/ussd/internal/http/at"
|
||||||
"git.grassecon.net/urdt/ussd/internal/storage"
|
"git.grassecon.net/urdt/ussd/internal/storage"
|
||||||
"git.grassecon.net/urdt/ussd/remote"
|
"git.grassecon.net/urdt/ussd/remote"
|
||||||
)
|
)
|
||||||
@ -121,10 +121,10 @@ func main() {
|
|||||||
defer stateStore.Close()
|
defer stateStore.Close()
|
||||||
|
|
||||||
rp := &at.ATRequestParser{
|
rp := &at.ATRequestParser{
|
||||||
context: ctx,
|
Context: ctx,
|
||||||
}
|
}
|
||||||
bsh := handlers.NewBaseSessionHandler(cfg, rs, stateStore, userdataStore, rp, hl)
|
bsh := handlers.NewBaseSessionHandler(cfg, rs, stateStore, userdataStore, rp, hl)
|
||||||
sh := httpserver.NewATSessionHandler(bsh)
|
sh := at.NewATSessionHandler(bsh)
|
||||||
|
|
||||||
mux := http.NewServeMux()
|
mux := http.NewServeMux()
|
||||||
mux.Handle(initializers.GetEnv("AT_ENDPOINT", "/"), sh)
|
mux.Handle(initializers.GetEnv("AT_ENDPOINT", "/"), sh)
|
||||||
|
@ -15,7 +15,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type ATRequestParser struct {
|
type ATRequestParser struct {
|
||||||
context context.Context
|
Context context.Context
|
||||||
}
|
}
|
||||||
|
|
||||||
func (arp *ATRequestParser) GetSessionId(rq any) (string, error) {
|
func (arp *ATRequestParser) GetSessionId(rq any) (string, error) {
|
||||||
@ -43,7 +43,7 @@ func (arp *ATRequestParser) GetSessionId(rq any) (string, error) {
|
|||||||
decodedStr := string(logBytes)
|
decodedStr := string(logBytes)
|
||||||
sessionId, err := extractATSessionId(decodedStr)
|
sessionId, err := extractATSessionId(decodedStr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
context.WithValue(arp.context, "at-session-id", sessionId)
|
context.WithValue(arp.Context, "at-session-id", sessionId)
|
||||||
}
|
}
|
||||||
logg.Debugf("Received request:", decodedStr)
|
logg.Debugf("Received request:", decodedStr)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user