1
0
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:
James Hillyerd
2013-11-07 10:56:50 -08:00
parent d80521b24d
commit 0f1e75b473
2 changed files with 6 additions and 2 deletions

View File

@@ -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 {