File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed
core/src/main/kotlin/net/osable/core Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -38,12 +38,9 @@ class SecurityConfiguration {
38
38
}.oauth2Client()
39
39
40
40
41
- // Useful for debugging CSRF
42
- if (environment.activeProfiles.contains(" development" )) {
43
- http.exceptionHandling().accessDeniedHandler { request, response, accessDeniedException ->
44
- println (" Access denied. Cause: ${accessDeniedException.cause} | Message: ${accessDeniedException.message} " )
45
- accessDeniedException.printStackTrace()
46
- }
41
+ http.exceptionHandling().accessDeniedHandler { request, response, accessDeniedException ->
42
+ println (" Access denied. Cause: ${accessDeniedException.cause} | Message: ${accessDeniedException.message} " )
43
+ accessDeniedException.printStackTrace()
47
44
}
48
45
49
46
return http.build()
Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ import org.springframework.web.bind.annotation.ResponseStatus
14
14
import org.springframework.web.reactive.function.client.WebClient
15
15
16
16
@Controller
17
+ // Allow cross-origin requests
18
+ @CrossOrigin
17
19
class FormController {
18
20
19
21
private val webClient = WebClient .builder()
@@ -26,8 +28,6 @@ class FormController {
26
28
@PostMapping(" /questions" , consumes = [MediaType .MULTIPART_FORM_DATA_VALUE ], headers = [" Host=api.osable.net" ])
27
29
// Method has a void return type, spring MVC tries to find a /questions page to redirect to without this annotation
28
30
@ResponseStatus(HttpStatus .OK )
29
- // Allow cross-origin requests from ourselves
30
- @CrossOrigin(origins = [" https://osable.net" ])
31
31
fun questionsContactRoute (@ModelAttribute contactRequest : ContactRequest ) {
32
32
webClient.post()
33
33
.uri(webhookURL)
You can’t perform that action at this time.
0 commit comments