diff options
Diffstat (limited to 'workflow-designer-be/src/main/java')
-rw-r--r-- | workflow-designer-be/src/main/java/org/onap/sdc/workflow/api/DisableSwaggerController.java | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/workflow-designer-be/src/main/java/org/onap/sdc/workflow/api/DisableSwaggerController.java b/workflow-designer-be/src/main/java/org/onap/sdc/workflow/api/DisableSwaggerController.java new file mode 100644 index 00000000..44aa8bb7 --- /dev/null +++ b/workflow-designer-be/src/main/java/org/onap/sdc/workflow/api/DisableSwaggerController.java @@ -0,0 +1,33 @@ +/* + * Copyright © 2019 European Support Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.sdc.workflow.api; + +import javax.servlet.http.HttpServletResponse; + +import org.springframework.context.annotation.Profile; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@Profile("!dev") +@RestController +public class DisableSwaggerController { + @RequestMapping("swagger-ui.html") + public void swagger(HttpServletResponse response) { + response.setStatus(HttpStatus.NOT_FOUND.value()); + } +} |