Skip to content

Commit

Permalink
fix: 修复 policy 为不存在时错误,返回404
Browse files Browse the repository at this point in the history
  • Loading branch information
maslow committed Aug 3, 2021
1 parent 81d50f7 commit f00ddba
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/app-server/src/router/entry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ EntryRouter.post('/proxy/:policy', async (req, res) => {
const policy_name = req.params?.policy

const policyComposition = PolicyAgentInstance.get(policy_name)
if (!policyComposition) {
return res.status(404).send('Policy Not Found')
}

const proxy = new Proxy(accessor, policyComposition.policy)

// parse params
Expand Down

0 comments on commit f00ddba

Please sign in to comment.