mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-18 01:57:02 +00:00
Make it possible to inject web DataStore for tests
This commit is contained in:
@@ -39,11 +39,10 @@ func headerMatch(req *http.Request, name string, value string) bool {
|
||||
func NewContext(req *http.Request) (*Context, error) {
|
||||
vars := mux.Vars(req)
|
||||
sess, err := sessionStore.Get(req, "inbucket")
|
||||
ds := smtpd.DefaultFileDataStore()
|
||||
ctx := &Context{
|
||||
Vars: vars,
|
||||
Session: sess,
|
||||
DataStore: ds,
|
||||
DataStore: DataStore,
|
||||
IsJson: headerMatch(req, "Accept", "application/json"),
|
||||
}
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user