Polishing external contribution

See gh-29985
This commit is contained in:
Arjen Poutsma
2023-10-03 16:44:20 +02:00
parent ad50de169c
commit 307a2c7d7b
14 changed files with 237 additions and 123 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -47,7 +47,7 @@ public class ResourceHandlerFunctionTests {
private final Resource resource = new ClassPathResource("response.txt", getClass());
private final ResourceHandlerFunction handlerFunction = new ResourceHandlerFunction(this.resource);
private final ResourceHandlerFunction handlerFunction = new ResourceHandlerFunction(this.resource, (r, h) -> {});
private ServerResponse.Context context;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -139,7 +139,7 @@ public class RouterFunctionBuilderTests {
assertThat(resource.exists()).isTrue();
RouterFunction<ServerResponse> route = RouterFunctions.route()
.resources("/resources/**", resource, resource1 -> CacheControl.maxAge(Duration.ofSeconds(60)))
.resources("/resources/**", resource, (r, headers) -> headers.setCacheControl(CacheControl.maxAge(Duration.ofSeconds(60))))
.build();
MockServerHttpRequest mockRequest = MockServerHttpRequest.get("https://localhost/resources/response.txt").build();