🎨 Improving structure / format of the code.

This commit is contained in:
萌萌哒Sakura酱 committed 2019-02-19 19:20:42 +08:00
1 parent 19b0d32d11
commit 1d4d76cbb1
2 files changed
+4 -5

No files matched your search

@@ -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()));
}
// 客户端异常直接返回客户端,不然无法解析