Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
8bc9bdc6bc
|
@ -58,6 +58,7 @@ public class Swagger2Parser extends SwaggerAbstractParser {
|
||||||
|
|
||||||
ApiModule parentNode = ApiDefinitionImportUtil.getSelectModule(importRequest.getModuleId());
|
ApiModule parentNode = ApiDefinitionImportUtil.getSelectModule(importRequest.getModuleId());
|
||||||
|
|
||||||
|
String basePath = swagger.getBasePath();
|
||||||
for (String pathName : pathNames) {
|
for (String pathName : pathNames) {
|
||||||
Path path = paths.get(pathName);
|
Path path = paths.get(pathName);
|
||||||
Map<HttpMethod, Operation> operationMap = path.getOperationMap();
|
Map<HttpMethod, Operation> operationMap = path.getOperationMap();
|
||||||
|
@ -68,6 +69,10 @@ public class Swagger2Parser extends SwaggerAbstractParser {
|
||||||
ApiDefinitionWithBLOBs apiDefinition = buildApiDefinition(request.getId(), operation, pathName, method.name(),importRequest);
|
ApiDefinitionWithBLOBs apiDefinition = buildApiDefinition(request.getId(), operation, pathName, method.name(),importRequest);
|
||||||
parseParameters(operation, request);
|
parseParameters(operation, request);
|
||||||
addBodyHeader(request);
|
addBodyHeader(request);
|
||||||
|
if (StringUtils.isNotBlank(basePath)) {
|
||||||
|
apiDefinition.setPath(basePath + apiDefinition.getPath());
|
||||||
|
request.setPath(basePath + request.getPath());
|
||||||
|
}
|
||||||
apiDefinition.setRequest(JSON.toJSONString(request));
|
apiDefinition.setRequest(JSON.toJSONString(request));
|
||||||
apiDefinition.setResponse(JSON.toJSONString(parseResponse(operation, operation.getResponses())));
|
apiDefinition.setResponse(JSON.toJSONString(parseResponse(operation, operation.getResponses())));
|
||||||
buildModule(parentNode, apiDefinition, operation.getTags());
|
buildModule(parentNode, apiDefinition, operation.getTags());
|
||||||
|
|
|
@ -42,7 +42,12 @@ public class CsrfFilter extends AnonymousFilter {
|
||||||
// 请求头取出的token value
|
// 请求头取出的token value
|
||||||
String csrfToken = httpServletRequest.getHeader(TOKEN_NAME);
|
String csrfToken = httpServletRequest.getHeader(TOKEN_NAME);
|
||||||
// 校验 token
|
// 校验 token
|
||||||
validateToken(csrfToken);
|
try {
|
||||||
|
validateToken(csrfToken);
|
||||||
|
} catch (ExpiredCredentialsException e) {
|
||||||
|
((HttpServletResponse) response).setHeader("Authentication-Status", "invalid");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
// 校验 referer
|
// 校验 referer
|
||||||
validateReferer(httpServletRequest);
|
validateReferer(httpServletRequest);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit f63ebb68ebad78de42fd711f17e2671e34577a86
|
Subproject commit 3571feccf7c2bc68e4b619f6c367ac47d37c6723
|
Loading…
Reference in New Issue