🎨 Improving structure / format of the code.
This commit is contained in:
1 parent
19b0d32d11
commit
1d4d76cbb1
2 files changed
+4
-5
No files matched your search
+3
-3
@@ -89,10 +89,10 @@ public class PigxWebResponseExceptionTranslator implements WebResponseExceptionT
|
||||
|
||||
int status = e.getHttpErrorCode();
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.set("Cache-Control", "no-store");
|
||||
headers.set("Pragma", "no-cache");
|
||||
headers.set(HttpHeaders.CACHE_CONTROL, "no-store");
|
||||
headers.set(HttpHeaders.PRAGMA, "no-cache");
|
||||
if (status == HttpStatus.UNAUTHORIZED.value() || (e instanceof InsufficientScopeException)) {
|
||||
headers.set("WWW-Authenticate", String.format("%s %s", OAuth2AccessToken.BEARER_TYPE, e.getSummary()));
|
||||
headers.set(HttpHeaders.WWW_AUTHENTICATE, String.format("%s %s", OAuth2AccessToken.BEARER_TYPE, e.getSummary()));
|
||||
}
|
||||
|
||||
// 客户端异常直接返回客户端,不然无法解析
|
||||
|
||||
Reference in new issue
Block a user