Skip to content

Commit f50326b

Browse files
committed
fix:modification in validation
1 parent a4ae43f commit f50326b

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/main/environment/common_ci.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,5 @@ springdoc.swagger-ui.enabled=@env.SWAGGER_DOC_ENABLED@
118118

119119
# Redis IP
120120
spring.redis.host=@env.REDIS_HOST@
121+
121122
cors.allowed-origins=@env.CORS_ALLOWED_ORIGINS@

src/main/java/com/wipro/fhir/config/CorsConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ public void addCorsMappings(CorsRegistry registry) {
2020
.map(String::trim)
2121
.toArray(String[]::new))
2222
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
23-
.allowedHeaders("*")
24-
.exposedHeaders("Authorization", "Jwttoken")
23+
.allowedHeaders("Content-Type", "Authorization")
24+
.exposedHeaders("Authorization")
2525
.allowCredentials(true)
2626
.maxAge(3600);
2727
}

src/main/java/com/wipro/fhir/utils/JwtUserIdValidationFilter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public void doFilter(ServletRequest servletRequest, ServletResponse servletRespo
4646
response.setHeader("Access-Control-Allow-Origin", origin);
4747
response.setHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS");
4848
response.setHeader("Access-Control-Allow-Headers", "Authorization, Content-Type, Accept, Jwttoken");
49+
response.setHeader("Vary", "Origin");
4950
response.setHeader("Access-Control-Allow-Credentials", "true");
5051
} else {
5152
logger.warn("Origin [{}] is NOT allowed. CORS headers NOT added.", origin);

0 commit comments

Comments
 (0)