Skip to content

Commit

Permalink
refactor: 0.4.4 (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
devxb authored May 9, 2024
2 parents b4cc3c9 + bbb0971 commit 3f209dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import jakarta.servlet.Filter
import jakarta.servlet.FilterChain
import jakarta.servlet.ServletRequest
import jakarta.servlet.ServletResponse
import jakarta.servlet.http.HttpServletRequest
import jakarta.servlet.http.HttpServletResponse
import org.springframework.http.HttpHeaders
import org.springframework.stereotype.Component
Expand All @@ -17,10 +16,7 @@ class CorsFilter : Filter {
response: ServletResponse,
chain: FilterChain
) {
(request as HttpServletRequest)
if (regexMatcher.matches(request.requestURI)) {
(response as HttpServletResponse).allowCors()
}
(response as HttpServletResponse).allowCors()
chain.doFilter(request, response)
}

Expand All @@ -34,8 +30,4 @@ class CorsFilter : Filter {
)
return this
}

private companion object {
private val regexMatcher = Regex("/users/.*")
}
}
2 changes: 2 additions & 0 deletions src/test/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ netx.logging.level=info

### GITHUB ###
github.token=1234

white.ip=127.0.0.1

0 comments on commit 3f209dc

Please sign in to comment.