1. 程式人生 > >shiro訪問許可權報錯:getPathWithinApplication(servletRequest) == /error

shiro訪問許可權報錯:getPathWithinApplication(servletRequest) == /error

業務:post資料到  /aaa/bbb/cc,然後被shiro攔截,輸出getPathWithinApplication(servletRequest) == "/error"

getPathWithinApplication(servletRequest)   //當前請求訪問的路徑

但是專案中所有的路徑中並無此路徑。

跟前端同事討論了一下,最後發現,在controller中配置中:

@RequestMapping(value = "/cc ", method = RequestMethod.POST...),路徑cc多加了一個空格...

解決方法:把空格去掉,重新部署自測,正常。

可能原因:此程式碼為17年提交的,即之前路徑是正常匹配的。跟其它同事聊了下,大致可能是因為近期升級了spring-boot,導致的路徑校驗會區分開空格。所以訪問路徑無效。具體原因,不打算深究。