Skip to content

Commit

Permalink
Refactor: code style (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahoo-Wang authored Jan 5, 2023
1 parent 26e78b2 commit e9afd1d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ abstract class XForwardedRemoteIpResolver<R>(

val xForwardedValues = xForwardedHeaderValues[0]
.split(DELIMITER)
.dropWhile { it.isBlank() }
.filter { it.isNotBlank() }
.reversed()
if (xForwardedValues.isEmpty()) {
return defaultRemoteIpResolver.resolve(request)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class DefaultPartExtractorTest {
DefaultPartExtractor(SecurityContextParts.PRINCIPAL_ATTRIBUTES_PREFIX + "key").extract(mockk(), context),
equalTo("value")
)
assertThat(
assertThat(
DefaultPartExtractor(SecurityContextParts.PRINCIPAL_ATTRIBUTES_PREFIX + "not_exist").extract(mockk(), context),
equalTo("")
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ import org.springframework.http.HttpHeaders
import org.springframework.web.server.ServerWebExchange

class ReactiveRequestParser(
private val remoteIPResolver: RemoteIpResolver<ServerWebExchange>
private val remoteIpResolver: RemoteIpResolver<ServerWebExchange>
) :
RequestParser<ServerWebExchange> {
override fun parse(request: ServerWebExchange): Request {
return ReactiveRequest(
delegate = request,
path = request.request.path.value(),
method = request.request.methodValue,
remoteIp = remoteIPResolver.resolve(request),
remoteIp = remoteIpResolver.resolve(request),
origin = request.request.headers.origin.orEmpty(),
referer = request.request.headers.getFirst(HttpHeaders.REFERER).orEmpty()
)
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# limitations under the License.
#
group=me.ahoo.cosec
version=1.8.5
version=1.8.6
description=RBAC-based And Policy-based Multi-Tenant Reactive Security Framework
website=https://github.com/Ahoo-Wang/CoSec
issues=https://github.com/Ahoo-Wang/CoSec/issues
Expand Down

0 comments on commit e9afd1d

Please sign in to comment.