Skip to content

Commit 4c0f148

Browse files
committed
switch to global confing of CORS
1 parent 8892975 commit 4c0f148

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/main/java/org/commonwl/view/WebConfig.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import org.springframework.context.annotation.Configuration;
2525
import org.springframework.http.MediaType;
2626
import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;
27+
import org.springframework.web.servlet.config.annotation.CorsRegistry;
2728
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
2829

2930
@Configuration
@@ -64,4 +65,9 @@ public void configureContentNegotiation(ContentNegotiationConfigurer configurer)
6465
.mediaType("yaml", parseMediaType("text/x-yaml"))
6566
.mediaType("raw", MediaType.APPLICATION_OCTET_STREAM);
6667
}
67-
}
68+
69+
@Override
70+
public void addCorsMappings(CorsRegistry registry) {
71+
registry.addMapping("/**"); // .setMaxAge(Long.MAX_VALUE)
72+
}
73+
}

src/main/java/org/commonwl/view/workflow/WorkflowController.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
import org.springframework.ui.Model;
4646
import org.springframework.validation.BeanPropertyBindingResult;
4747
import org.springframework.validation.BindingResult;
48-
import org.springframework.web.bind.annotation.CrossOrigin;
4948
import org.springframework.web.bind.annotation.GetMapping;
5049
import org.springframework.web.bind.annotation.PathVariable;
5150
import org.springframework.web.bind.annotation.PostMapping;
@@ -90,7 +89,6 @@ public WorkflowController(WorkflowFormValidator workflowFormValidator,
9089
* @return The workflows view
9190
*/
9291
@GetMapping(value="/workflows")
93-
@CrossOrigin
9492
public String listWorkflows(Model model, @PageableDefault(size = 10) Pageable pageable) {
9593
model.addAttribute("workflows", workflowService.getPageOfWorkflows(pageable));
9694
model.addAttribute("pages", pageable);

0 commit comments

Comments
 (0)