20 lines
295 B
Go
20 lines
295 B
Go
package httphandlers
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"fiskerinc.com/modules/common/context"
|
|
)
|
|
|
|
const ClientIDContextKey context.ContextType = "client_id"
|
|
|
|
func GetClientID(r *http.Request) string {
|
|
v := r.Context().Value(ClientIDContextKey)
|
|
id, ok := v.(string)
|
|
if !ok {
|
|
return ""
|
|
}
|
|
|
|
return id
|
|
}
|