Skip to content

Proposal: Allow to change net/http.Server base context #16220

Closed
@gregory-m

Description

@gregory-m

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?
    go version go1.7beta2 darwin/amd64

  2. What did you do?
    I'am trying to setup my session store and pass it to handlers via http.Request.Context()

  3. What did you expect to see?
    Some way to do this.
    Like:

    ctx := context.WithValue(context.Background(), seesionStoreKey, SessionStore{})
    
    s := &http.Server{
      BaseContex: ctx
    }
    s.ListenAndServe()
    
    #And use it inside handler:
    store, ok := r.Context().Value(seesionStoreKey).(SessionStore)
    
  4. What did you see instead?

I can't change base http.Request.Context()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions