Skip to content

Commit

Permalink
fix: 게시물 api url 대응 (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
yongbin97 committed Oct 3, 2024
1 parent 71c8707 commit 312b093
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ dependencies {
// Swagger
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2'

implementation group: 'org.json', name: 'json', version: '20090211'
implementation group: 'org.json', name: 'json', version: '20231013'

compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
.requestMatchers("/exception/**").permitAll()
.requestMatchers("/swagger-ui/**").permitAll()
.requestMatchers("/api-docs/**").permitAll()
.requestMatchers(HttpMethod.POST, "/post").permitAll()
.requestMatchers(HttpMethod.GET, "/post/*").permitAll()
.requestMatchers(HttpMethod.PATCH, "/post/*/summary").permitAll()
.requestMatchers(HttpMethod.POST, "/posts").permitAll()
.requestMatchers(HttpMethod.GET, "/posts/*").permitAll()
.requestMatchers(HttpMethod.PATCH, "/posts/*/summary").permitAll()
.anyRequest().authenticated()
)
.addFilterBefore(jwtFilter, UsernamePasswordAuthenticationFilter.class)
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/project/backend/security/jwt/JwtFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ private void setErrorResponse(HttpServletResponse response) throws IOException {

private static boolean isRequestSummaryURI(HttpServletRequest request) {
// 요약하기
if (request.getRequestURI().equals("/post") && request.getMethod()
.equals(HttpMethod.POST.name())) {
if (request.getRequestURI().equals("/posts") && request.getMethod()
.equals(HttpMethod.POST.name())) {
return true;
}
// 재요약하기
if (request.getRequestURI().matches("/post/[0-9]+/summary") && request.getMethod().equals(
if (request.getRequestURI().matches("/posts/[0-9]+/summary") && request.getMethod().equals(
HttpMethod.PATCH.name())) {
return true;
}
Expand Down

0 comments on commit 312b093

Please sign in to comment.