Skip to content
Snippets Groups Projects
Unverified Commit 25ddfa58 authored by fangyincheng's avatar fangyincheng Committed by GitHub
Browse files

Merge pull request #707 from williamfeng323/bugfix-application-router

Fix: application router get application name from dir.url and dir.url.suburl
parents 25281bf9 30c587eb
No related branches found
No related tags found
No related merge requests found
......@@ -112,11 +112,15 @@ func (dir *BaseDirectory) SetRouters(urls []*common.URL) {
func (dir *BaseDirectory) isProperRouter(url *common.URL) bool {
app := url.GetParam(constant.APPLICATION_KEY, "")
dirApp := dir.GetUrl().GetParam(constant.APPLICATION_KEY, "")
if len(dirApp) == 0 && dir.GetUrl().SubURL != nil {
dirApp = dir.GetUrl().SubURL.GetParam(constant.APPLICATION_KEY, "")
}
serviceKey := dir.GetUrl().ServiceKey()
if serviceKey == "" {
if len(serviceKey) == 0 {
serviceKey = dir.GetUrl().SubURL.ServiceKey()
}
if len(app) > 0 && app == dir.GetUrl().GetParam(constant.APPLICATION_KEY, "") {
if len(app) > 0 && app == dirApp {
return true
}
if url.ServiceKey() == serviceKey {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment