Skip to content

Commit

Permalink
fix: cors
Browse files Browse the repository at this point in the history
  • Loading branch information
essential2189 committed Jan 28, 2024
1 parent 7da843d commit e883299
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
8 changes: 3 additions & 5 deletions src/main/java/com/todaypopup/todaypopup/WebConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ public class WebConfig implements WebMvcConfigurer {
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("*")
.allowedMethods("GET", "POST", "PUT", "DELETE")
// .allowedHeaders("Authorization", "Content-Type")
// .exposedHeaders("Custom-Header")
.allowCredentials(true)
.maxAge(3600);
.allowedMethods("*")
.allowedHeaders("*")
.allowCredentials(false).maxAge(6000);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@
import com.todaypopup.todaypopup.domain.region.dto.SigunguDto;
import com.todaypopup.todaypopup.domain.region.repository.SidoRepository;
import com.todaypopup.todaypopup.domain.region.repository.SigunguRepository;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Collections;
import java.util.List;
import java.util.Optional;
import org.springframework.stereotype.Service;

@Service
@Transactional
public class RegionServiceImpl implements RegionService {

private final SidoRepository sidoRepository;
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ spring:
password: ${{ MYSQL_PASSWORD_DEV }}

jpa:
open-in-view: true
show-sql: true
open-in-view: false
show-sql: false
hibernate:
ddl-auto: none
naming:
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
properties:
hibernate.format_sql: true
hibernate.format_sql: false
jdbc:
time_zone: KST
2 changes: 1 addition & 1 deletion src/main/resources/application-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spring:
password: root

jpa:
open-in-view: true
open-in-view: false
show-sql: true
hibernate:
ddl-auto: none
Expand Down

0 comments on commit e883299

Please sign in to comment.