Skip to content

Commit

Permalink
Merge pull request #103 from ADORSYS-GIS/fix/cors-origin
Browse files Browse the repository at this point in the history
chore(): added x-forwarded config
  • Loading branch information
Elwizzy12 authored Dec 18, 2024
2 parents 28398d4 + db1f7a7 commit 20a34b8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

@RestController
@RequestMapping("/api/registration")
@CrossOrigin(origins = "http://localhost:5173")
public interface RegistrationResourceApi {

@Operation(summary = "Register a new bank account", description = "Accepts a phone number and public key for registration")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.adorsys.webank.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.filter.ForwardedHeaderFilter;

@Configuration
public class ForwardedHeaderConfig {

@Bean
public ForwardedHeaderFilter forwardedHeaderFilter() {
return new ForwardedHeaderFilter();
}
}
4 changes: 2 additions & 2 deletions online-banking-app/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ spring.profiles.active=h2
server.forward-headers-strategy=native
server.tomcat.remote-ip-header=x-forwarded-for
server.tomcat.protocol-header=x-forwarded-proto


# Ensure Tomcat handles forwarded headers
server.tomcat.forward-headers-strategy=native

0 comments on commit 20a34b8

Please sign in to comment.