Skip to content

Commit

Permalink
Fix default middleware driver for JSVM
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickTaibel committed Dec 20, 2022
1 parent 82acc2f commit 90c96fa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gateway/api_definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ func (a APIDefinitionLoader) MakeSpec(def *apidef.APIDefinition, logger *logrus.
logger.WithError(err).Error("Couldn't load bundle")
}

if a.Gw.GetConfig().EnableJSVM && (spec.hasVirtualEndpoint() || spec.CustomMiddleware.Driver == apidef.OttoDriver) {
if a.Gw.GetConfig().EnableJSVM && (spec.hasVirtualEndpoint() || spec.CustomMiddleware.Driver == apidef.OttoDriver || spec.CustomMiddleware.Driver == "") {
logger.Debug("Initializing JSVM")
spec.JSVM.Init(spec, logger, a.Gw)
}
Expand Down
2 changes: 1 addition & 1 deletion gateway/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ func (gw *Gateway) loadCustomMiddleware(spec *APISpec) ([]string, apidef.Middlew
mwPostFuncs := []apidef.MiddlewareDefinition{}
mwPostKeyAuthFuncs := []apidef.MiddlewareDefinition{}
mwResponseFuncs := []apidef.MiddlewareDefinition{}
mwDriver := apidef.MiddlewareDriver("")
mwDriver := apidef.OttoDriver

// Set AuthCheck hook
if spec.CustomMiddleware.AuthCheck.Name != "" {
Expand Down

0 comments on commit 90c96fa

Please sign in to comment.