Commit Graph

3996 Commits

Author SHA1 Message Date
Alex Lei 195b622411 Support multiple base64 segments in Content-Disposition
See gh-28236
2022-04-29 12:36:42 +02:00
Arjen Poutsma 217117ced0 Remove Jakarta Mail dependency from spring-web
This commit removes the dependency that the spring-web module has on
Jakarta Mail.

In FormHttpMessageConverter, a dependency on
jakarta.mail.internet.MimeUtility was replaced by existing encoding
logic in ContentDisposition.

In StandardMultipartHttpServletRequest, a dependency on the same
MimeUtility was replaced by new quoted-printable decoding logic in
ContentDisposition.

Closes gh-28392
2022-04-28 15:39:52 +02:00
rstoyanchev b4e6014a14 Merge branch '5.3.x' into main 2022-04-28 11:40:11 +01:00
rstoyanchev f0d149b330 Polishing contribution
Closes gh-27830
2022-04-28 11:26:50 +01:00
binchoo caaf83b8e6 Add tests for binding to a Part field
See gh-27830
2022-04-28 10:45:09 +01:00
rstoyanchev 62ab360f64 Update HttpMethodArgumentResolver
Boolean return value indicates if the value was resolved or not.

See gh-28386
2022-04-27 21:21:43 +01:00
rstoyanchev b1384ddafa Add HttpServiceProxyFactory builder
See gh-28386
2022-04-27 21:21:43 +01:00
rstoyanchev 8a46e96875 Add remaining HttpExchange annotations
See gh-28386
2022-04-27 21:21:43 +01:00
rstoyanchev d7ab5b4132 Refactor HttpRequestSpec to HttpRequestValues
HttpRequestValues is immutable and exposes a builder.

See gh-28386
2022-04-27 21:21:43 +01:00
rstoyanchev 564f8ba7a0 Update after review
See gh-28386
2022-04-27 21:21:43 +01:00
rstoyanchev bb44c0e13a Polishing
See gh-28386
2022-04-27 21:21:43 +01:00
rstoyanchev 4bddbd30c4 Polishing contribution
See gh-28386
2022-04-27 21:21:43 +01:00
Olga Maciaszek-Sharma c2a008fc22 Add HttpMethod and PathVariable argument resolvers
See gh-28386
2022-04-27 21:21:43 +01:00
rstoyanchev c418768f05 Add @HttpRequest and HttpServiceProxyFactory
See gh-28386
2022-04-27 21:21:43 +01:00
Stephane Nicoll ccb66247ce Merge branch '5.3.x' 2022-04-24 10:05:35 +02:00
izeye fcf64798b5 Add Javadoc since for GraphQL constants
See gh-28369
2022-04-24 09:58:50 +02:00
Arjen Poutsma be7fa3aaa8 Introduce PartEvent
This commit introduces the PartEvent API. PartEvents are either
- FormPartEvents, representing a form field, or
- FilePartEvents, representing a file upload.

The PartEventHttpMessageReader is a HttpMessageReader that splits
multipart data into a stream of PartEvents. Form fields generate one
FormPartEvent; file uploads produce at least one FilePartEvent. The last
element that makes up a particular part will have isLast set to true.

The PartEventHttpMessageWriter is a HttpMessageWriter that writes a
Publisher<PartEvent> to a outgoing HTTP message. This writer is
particularly useful for relaying a multipart request on the server.

Closes gh-28006
2022-04-20 11:00:07 +02:00
Sam Brannen 1574fed90b Merge branch '5.3.x' 2022-04-13 10:08:31 +02:00
Sam Brannen a7cf19cec5 Improve documentation and matching algorithm in data binders 2022-04-13 09:55:40 +02:00
Juergen Hoeller 8744952424 Merge branch '5.3.x' 2022-04-13 00:28:22 +02:00
Juergen Hoeller 0cf7f7bd89 Polishing 2022-04-13 00:24:23 +02:00
Arjen Poutsma 6e9a662290 Merge branch '5.3.x' 2022-04-12 16:52:49 +02:00
Arjen Poutsma 3b4ae7b028 TomcatHttpHandlerAdapter continues after 0 bytes
This commit makes sure that TomcatServerHttpRequest::readFromInputStream
follows the same contract as the method it overrides, and returns
AbstractListenerReadPublisher.EMPTY_BUFFER when 0 bytes are read.

See gh-28241
2022-04-12 16:52:13 +02:00
Stephane Nicoll ab7213c823 Merge branch '5.3.x' 2022-04-12 16:14:05 +02:00
Stephane Nicoll 8b39698553 Upgrade to Reactor 2020.0.18
Closes gh-28329
2022-04-12 15:53:10 +02:00
Arjen Poutsma 5fc8a9839c Do not add Accept-Ranges header on client-side
This commit fixes a regression that added the Accept-Ranges header on
both client and server. Accept-Ranges is response header, so we now make
sure it only appears on the server side.

See gh-28291
2022-04-12 10:36:49 +02:00
Juergen Hoeller 9ae35e78b1 Merge branch '5.3.x'
# Conflicts:
#	spring-context-support/src/test/java/org/springframework/validation/beanvalidation2/ValidatorFactoryTests.java
#	spring-context/src/test/java/org/springframework/validation/beanvalidation/ValidatorFactoryTests.java
#	spring-web/src/main/java/org/springframework/http/server/reactive/ServletServerHttpRequest.java
2022-04-08 14:42:12 +02:00
Juergen Hoeller 10e979e58b Polishing 2022-04-08 14:37:41 +02:00
Juergen Hoeller 7e1782ea22 Merge branch '5.3.x'
# Conflicts:
#	build.gradle
#	spring-core/src/main/java/org/springframework/core/convert/Property.java
2022-04-08 13:10:34 +02:00
Juergen Hoeller 4143b445d6 Polishing 2022-04-08 13:04:14 +02:00
Juergen Hoeller eefdd2c768 Avoid return value reference in potentially cached MethodParameter instance
Closes gh-28232
2022-04-08 13:03:13 +02:00
Juergen Hoeller c3fe112fd7 Consistent use of getLocalAddr() without DNS lookups in request adapters
Closes gh-28280
2022-04-08 13:00:50 +02:00
Arjen Poutsma 9adfa5e8b0 Add HEAD support in MVC/WebFlux Resource handling
This commit introduces explicit HEAD support in Spring
MVC's ResourceHttpRequestHandler and WebFlux's ResourceWebHandler,
adding just headers but no body.

Closes gh-28291
2022-04-07 13:51:21 +02:00
Arjen Poutsma 192f2becf6 Automatically clean up multipart temp files
This commit ensures that any resources created for multipart handling,
obtained via ServerWebExchange.getMultipartData(), are automatically
deleted after handling the completing the response.

Resource for parts obtained via BodyExtractors::toMultipartData and
BodyExtractors::toParts are not cleaned automatically, and
should be cleaned via Part::delete.

Closes gh-27633
2022-04-06 17:02:31 +02:00
Brian Clozel fd1346bf66 Merge branch '5.3.x' 2022-04-01 19:25:11 +02:00
Brian Clozel 17f7a24118 Add application/graphql+json mime and media types
Closes gh-28271
2022-04-01 19:24:55 +02:00
rstoyanchev aea39fdad3 Merge branch '5.3.x' into main 2022-04-01 17:57:48 +01:00
rstoyanchev d518a7d8c8 AbstractListenerReadPublisher continues after 0 bytes
If we read 0 bytes, e.g. chunked encoding markup read but not the
actual data within it, don't stop reading since the server may or
may not consider it necessary to call onDataAvailable again.
Instead, we keep on reading, and although isReady likely returns
false on the next iteration, it eliminates ambiguity and ensures
the server will call onDataAvailable when more data arrives.

Closes gh-28241
2022-04-01 17:38:03 +01:00
Sam Brannen 7a1421cb0f Suppress deprecation warnings in tests 2022-03-29 15:04:58 +02:00
Brian Clozel 7161940b53 Merge branch '5.3.x' 2022-03-24 13:44:38 +01:00
Arjen Poutsma 72e7ae60d4 Polish Javadoc for AbstractClientHttpResponse 2022-03-23 16:00:15 +01:00
Sam Brannen 6cc685034e Polishing 2022-03-23 15:18:56 +01:00
Arjen Poutsma 28ac0d3883 Use HttpStatusCode interface
This commit contains changes made because of the introduction of
HttpStatusCode. In general, methods that used to return a HttpStatus
now return HttpStatusCode instead, and methods that returned raw status
codes are now deprecated.

See gh-28214
2022-03-23 12:49:38 +01:00
Arjen Poutsma ca4b6e86a4 Introduce HttpStatusCode interface
This commit introduces HttpStatusCode, an interface implemented by
HttpStatus. Instances of HttpStatusCode are obtained via static
valueOf(int) factory method, returning a HttpStatus enum entry if
available, and a default implementation otherwise.

The underlying reason behind this change is HTTP status codes are not
enumerable, but instead range from 100-999.

Closes gh-28214
2022-03-23 11:35:57 +01:00
Sam Brannen 9a5891e6e6 Explicitly close ApplicationContexts and clean up warnings in tests
This commit also ensures that various test methods actually test
something now.
2022-03-20 12:34:56 +01:00
Sam Brannen b570f60560 Merge branch '5.3.x'
# Conflicts:
#	spring-aop/src/main/java/org/springframework/aop/support/AopUtils.java
#	spring-aop/src/main/java/org/springframework/aop/support/annotation/AnnotationClassFilter.java
#	spring-aop/src/main/java/org/springframework/aop/support/annotation/AnnotationMatchingPointcut.java
#	spring-aop/src/main/java/org/springframework/aop/support/annotation/AnnotationMethodMatcher.java
#	spring-beans/src/main/java/org/springframework/beans/factory/annotation/RequiredAnnotationBeanPostProcessor.java
#	spring-context/src/main/java/org/springframework/context/annotation/CommonAnnotationBeanPostProcessor.java
#	spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedNotification.java
#	spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedOperationParameter.java
#	spring-core/src/main/java/org/springframework/javapoet/support/package-info.java
#	spring-core/src/main/java/org/springframework/util/TypeUtils.java
#	spring-web/src/main/java/org/springframework/http/HttpMethod.java
2022-03-18 16:47:12 +01:00
Sam Brannen 64b64d9ba0 Stop referring to features as "Java 5" features
With a Java 8 baseline in place for quite some time now, it no longer
makes sense to refer to features such as annotations as "Java 5
annotations".

This commit also removes old `Tiger*Tests` classes, thereby avoiding
duplicate execution of various tests.
2022-03-18 16:32:30 +01:00
Sam Brannen 9764f0e59b Merge branch '5.3.x'
# Conflicts:
#	spring-test/src/test/java/org/springframework/mock/http/server/reactive/MockServerHttpRequestTests.java
#	spring-web/src/test/java/org/springframework/http/server/reactive/HeadersAdaptersTests.java
#	spring-web/src/test/java/org/springframework/web/client/RestTemplateIntegrationTests.java
#	spring-webflux/src/test/java/org/springframework/web/reactive/function/client/WebClientIntegrationTests.java
#	spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/SseIntegrationTests.java
#	spring-webmvc/src/test/java/org/springframework/web/servlet/handler/MappedInterceptorTests.java
#	spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/HandlerMethodAnnotationDetectionTests.java
#	spring-websocket/src/test/java/org/springframework/web/socket/AbstractWebSocketIntegrationTests.java
2022-03-16 15:07:53 +01:00
Sam Brannen c462fe30ed Use Named arguments in parameterized tests 2022-03-16 14:45:47 +01:00
rstoyanchev e7b97f5be7 Merge branch '5.3.x' into main 2022-03-16 09:27:43 +00:00
rstoyanchev 21d61316be Unwrap MappingJacksonValue before selecting ObjectMapper
See gh-28045
2022-03-16 05:55:58 +00:00
rstoyanchev cb39b07088 Polishing Jackson encoder tests 2022-03-16 05:55:23 +00:00
Brian Clozel 6f41180cc5 Align AsyncRestTemplate error logging with RestTemplate
Prior to this commit, `AsyncRestTemplate` would log errors (including
simple 404s) with WARN level. Such errors are quite common and should
not clutter logs.

This commit aligns the logging strategy with RestTemplate, using the
DEBUG level for such cases.

Fixes gh-28049
2022-02-28 16:37:07 +01:00
rstoyanchev b045e5baef Tests for ErrorResponse hierarchy to verify the output
See gh-27052
2022-02-28 13:40:05 +00:00
rstoyanchev 76be6373a8 ErrorResponse support in Spring MVC exception hierarchy
All Spring MVC exceptions from spring-web, now implement ErrorResponse
and expose HTTP error response information, including an RFC 7807 body.

See gh-27052
2022-02-28 13:40:05 +00:00
rstoyanchev 3efedef161 Add ErrorResponse and ErrorResponseException
ErrorResponse represents a complete error response with status, headers,
and an  RFC 7807 ProblemDetail body.

ErrorResponseException implements ErrorResponse and is usable on its
own or as a base class. ResponseStatusException extends
ErrorResponseException and now also supports RFC 7807 and so does its
sub-hierarchy.

ErrorResponse can be returned from `@ExceptionHandler` methods and is
mapped to ResponseEntity.

See gh-27052
2022-02-28 13:40:05 +00:00
rstoyanchev 714d451260 Add ProblemDetail and `@ExceptionHandler` support
ProblemDetail is a representation of an RFC 7807 "problem", and this
commits adds support for it in Spring MVC and WebFlux as a return value
from `@ExceptionHandler` methods, optionally wrapped with
ResponseEntity for headers.

See gh-27052
2022-02-28 13:40:05 +00:00
Sam Brannen 8c6d59aaaf Polish contribution
See gh-28014
2022-02-19 14:43:26 +01:00
a.yazychyan c5c926726d Use enhanced switch expressions where feasible
Closes gh-28014
2022-02-19 14:34:05 +01:00
Phillip Webb b3306f4e3d Suppress deprecation warning in WebAsyncManagerTests
See gh-27959
2022-02-15 15:11:31 -08:00
Sam Brannen 685a195ba1 Deprecate SocketUtils
SocketUtils was introduced in Spring Framework 4.0, primarily to assist
in writing integration tests which start an external server on an
available random port. However, these utilities make no guarantee about
the subsequent availability of a given port and are therefore
unreliable. Instead of using SocketUtils to find an available local
port for a server, it is recommended that users rely on a server's
ability to start on a random port that it selects or is assigned by the
operating system. To interact with that server, the user should query
the server for the port it is currently using.

SocketUtils is now deprecated in 5.3.16 and will be removed in 6.0.

Closes gh-28052
2022-02-15 14:28:58 +01:00
Brian Clozel bfe9d4fc49 Merge branch '5.3.x' 2022-02-14 16:23:49 +01:00
Brian Clozel 88f73bffa0 Make assertion message lazy in ServletRequestPathUtils
Closes gh-27946
2022-02-14 16:21:41 +01:00
rstoyanchev 7ecfce2386 Polishing contribution
See gh-27948
2022-02-14 11:26:40 +00:00
heowc ad2722b3a3 MissingServletRequestPartException extends ServletRequestBindingException
Closes gh-27948
2022-02-14 11:26:40 +00:00
Juergen Hoeller 9688e61e20 Upgrade to Groovy 4.0
Closes gh-27985
2022-02-04 21:01:02 +01:00
Sam Brannen b3f786728e Use modern language features in tests 2022-02-03 15:35:32 +01:00
Sam Brannen 54565e95b5 Merge branch '5.3.x' 2022-02-03 14:58:36 +01:00
Sam Brannen f8a5a8d7be Use modern language features in tests 2022-02-03 14:50:10 +01:00
rstoyanchev 823958bcc5 Merge branch '5.3.x' into main
Remove use of Mockito spy proxies, which don't work on Java 17.
2022-02-02 17:35:54 +00:00
rstoyanchev c4e362500b Polishing tests 2022-02-02 17:09:04 +00:00
rstoyanchev 8d5a6520ce Ensure all converters don't close InputStream
Closes gh-27969
2022-02-02 15:55:13 +00:00
rstoyanchev 4effca35b5 Ignore Content-Type that is invalid (not concrete)
Closes gh-27957
2022-02-02 15:55:07 +00:00
Sam Brannen de33e3b575 Merge branch '5.3.x' 2022-01-29 12:43:18 +01:00
Sam Brannen dbeae27d3c Reduce build time by reducing shutdown wait period for Jetty tests 2022-01-29 12:41:39 +01:00
Arjen Poutsma a9a6b071d9 Merge branch '5.3.x' 2022-01-28 13:45:45 +01:00
Arjen Poutsma caa13690e8 Support multiple boundary buffers in MultipartParser
In a small minority of cases, the multipart boundary can spread across
three incoming buffers.

Prior to this commit, MultipartParser.BodyState only supported two
buffers. If the boundary is spread across three buffers, the first
buffer of the three is sent as a whole, even though it contains the
first bytes of the boundary.

This commit fixes this bug, by enqueuing all prior buffers in a queue,
and emitting the ones that cannot contain boundary bytes.

Closes gh-27939
2022-01-28 13:42:24 +01:00
Sam Brannen 786d80c0bb Merge branch '5.3.x' 2022-01-27 16:13:55 +01:00
Sam Brannen 6647023151 Document how to register annotated classes in a GenericWebApplicationContext
Closes gh-27778
2022-01-27 16:08:16 +01:00
Sam Brannen e32f94bf8c Polish GenericWebApplicationContext and AnnotationConfigWebApplicationContext 2022-01-27 16:08:07 +01:00
Sam Brannen 912bb16e44 Merge branch '5.3.x' 2022-01-20 15:54:50 +01:00
shirohoo 7211912057 Polish tests in spring-web
This PR polishes trivial things in tests in spring-web.

Closes gh-27958
2022-01-20 15:44:24 +01:00
Juergen Hoeller 50faa29329 Merge branch '5.3.x'
# Conflicts:
#	build.gradle
2022-01-12 16:38:19 +01:00
Juergen Hoeller 6b3052200a Skip "data:" lines without content
Closes gh-27923
2022-01-12 16:35:42 +01:00
rstoyanchev d61d0d41a3 Merge branch '5.3.x' into main 2022-01-12 09:02:07 +00:00
rstoyanchev 34cb5df859 Consistent id for ReactorServerHttpRequest
Closes gh-27885
2022-01-12 08:55:32 +00:00
rstoyanchev 7665424ea8 Polishing contribution
Closes gh-27888
2022-01-12 08:55:32 +00:00
Max Demydenko f63a106c85 clear() method also clears argument resolver cache
See gh-27888
2022-01-12 08:55:32 +00:00
rstoyanchev caaf48d4ec Add missing overrides to ServerHttpResponseDecorator
Closes gh-27889
2022-01-12 08:55:32 +00:00
rstoyanchev 6643efe0b4 Merge branch '5.3.x' into main 2022-01-11 18:48:49 +00:00
rstoyanchev e8e7fbba94 Polishing contribution and fix failing test
The failing test is for Apache HttpComponents where we cannot apply the
Content-Length together with other headers, and must pass it instead
explicitly to ReactiveEntityProducer when writing at which point it gets
set in the native headers.

Closes gh-27768
2022-01-11 17:07:26 +00:00
sokomishalov bd1f34e174 Apply adapters to client request headers after committed
See gh-27768
2022-01-11 15:30:03 +00:00
Arjen Poutsma b848acd86d Merge branch '5.3.x' 2022-01-11 13:44:45 +01:00
Arjen Poutsma a490723f02 NettyHeadersAdapter::putAll does not overwrite headers
Similar to 4078b73cec, but for the
client-side NettyHeadersAdapter::putAll.

See gh-27887
2022-01-11 13:33:15 +01:00
Sam Brannen d57bc176f2 Merge branch '5.3.x' 2022-01-10 14:21:25 +01:00
Sam Brannen df263d01b9 Use idiomatic AssertJ assertions for true, false, and null 2022-01-10 14:15:55 +01:00
Arjen Poutsma 1941ae6696 Merge branch '5.3.x' 2022-01-10 11:01:38 +01:00
Arjen Poutsma 4078b73cec NettyHeadersAdapter::putAll does not overwrite headers
NettyHeadersAdapter::putAll uses HttpHeaders::add, which does not
overwrite existing headers. putAll should use HttpHeaders::set instead,
just like NettyHeadersAdapter::put does.

Closes gh-27887
2022-01-10 10:54:04 +01:00
Sam Brannen 202b7ea47b Merge branch '5.3.x' 2022-01-04 15:17:05 +01:00
Sam Brannen c3ce4f0f90 Polish contribution
See gh-27823
2022-01-04 15:12:29 +01:00
Marten Deinum e1200f34e7 Use try-with-resources for AutoClosables where feasible
Where unfeasible, this commit adds inline comments to explain why
try-with-resources must not be used in certain scenarios. The purpose
of the comments is to avoid accidental conversion to try-with-resources
at a later date.

Closes gh-27823
2022-01-04 15:12:29 +01:00
Marten Deinum 948f5999c3 Replace use of StringBuffer with StringBuilder
With JDK 9, java.util.regex.Matcher received overloaded variants of
appendReplacement() and appendTail() that accept a StringBuilder,
allowing us to replace the use of StringBuffer with StringBuilder.

Closes gh-27822
2022-01-04 13:14:17 +01:00
Marten Deinum 941b6af9ac Use Collection factory methods when applicable
This commit replaces the use of Collections.unmodifiableList/Set/Map
with the corresponding 'of(...)' factory methods introduced in Java 9.

Closes gh-27824
2022-01-04 12:01:13 +01:00
Sam Brannen 6555d3b42d Suppress warnings in tests 2022-01-03 16:12:14 +01:00
Sam Brannen 97625e3658 Additional changes because HttpMethod changed from enum to class
See gh-27697
2022-01-03 16:12:14 +01:00
Stephane Nicoll 900e0f56eb Polish "Fix typo and use of componentry"
See gh-27852
2021-12-29 11:05:27 +01:00
liuzhifei 65d2e9bb54 Fix typo and use of componentry
See gh-27852
2021-12-29 11:01:41 +01:00
izeye 713795cc34 Polish
See gh-27827
2021-12-21 09:36:08 +01:00
Stephane Nicoll ac1032ffc9 Polish formatting
See gh-27833
2021-12-21 09:34:39 +01:00
izeye 731af9444c Polish HtmlCharacterEntityDecoder
See gh-27833
2021-12-21 09:32:46 +01:00
Stephane Nicoll 1aaf5262b1 Polish formatting
See gh-27835
2021-12-21 09:22:03 +01:00
izeye 08a34ca1ec Polish HttpMethod
See gh-27835
2021-12-21 09:20:29 +01:00
Juergen Hoeller aeff664cf9 Polishing 2021-12-14 09:46:52 +01:00
Juergen Hoeller ba468a731f Remove JamonPerformanceMonitorInterceptor support
Includes upgrade to Tomcat 10.0.14, Undertow 2.2.14, Apache HttpClient 5.1.2, Hibernate ORM 5.6.2, Mockito 4.1.

Closes gh-27786
2021-12-14 09:46:08 +01:00
Rossen Stoyanchev a15393836c Merge branch '5.3.x' into main 2021-12-09 15:35:21 +00:00
Rossen Stoyanchev e9083d7d20 Apply LogFormatUtils in more places 2021-12-09 14:53:52 +00:00
Juergen Hoeller 14f24f43d7 Polishing 2021-12-03 22:36:31 +01:00
Rossen Stoyanchev 2d2db530b1 Merge branch '5.3.x' into main 2021-12-02 12:35:48 +00:00
Rossen Stoyanchev 6582787678 Apply resources after application HttpClient mapper
Closes gh-27749
2021-12-02 12:28:36 +00:00
ydh6226 a0ba808217 Use HttpHeaders.ALLOW instead of String constant
This commit changes "Allow" strings into HttpHeaders.ALLOW.

See gh-27356
2021-12-02 12:28:36 +01:00
Frederick Zhang baed0785fd Replace XMLReaderFactory with SAXParserFactory
XMLReaderFactory has been marked as deprecated and without additional
configuration, and it's slower than SAXParserFactory.

Previously `XMLReaderFactory.createXMLReader()` is called upon every
request. This is an anti-pattern as mentioned in [1] and it can be very
slow since it loads the jar service file unless a parser has been
pre-assigned [2] (e.g. by setting org.xml.sax.driver).

SAXParserFactory uses a FactoryFinder [3] instead, which takes advantage
of a thread-local cache provided by ServiceLoader. Developers can still
pre-assign a factory by setting javax.xml.parsers.SAXParserFactory to
make it faster.

[1] https://bugs.openjdk.java.net/browse/JDK-6925410
[2] c8add223a1/src/java.xml/share/classes/org/xml/sax/helpers/XMLReaderFactory.java (L144-L148)
[3] 66c653c561/src/java.xml/share/classes/javax/xml/parsers/SAXParserFactory.java (L181-L185)

See gh-27239
2021-12-02 11:32:46 +01:00
Arjen Poutsma 445f25c466 Use HttpMethod::valueOf in HttpMethod::resolve
This commit makes sure that HttpMethod::resolve uses HttpMethod::valueOf
and returns an HttpMethod for non-standard methods.

See gh-27697
2021-11-30 14:59:42 +01:00
Arjen Poutsma da3b4cb65d Polish 2021-11-30 14:09:33 +01:00
Arjen Poutsma 7a4207cd7b Changes because HttpMethod changed to class
This commit contains changes made because HttpMethod changed from enum
to class.

See gh-27697
2021-11-30 13:44:36 +01:00
Arjen Poutsma 6e335e3a9f Refactor HTTP Method from Enum to Class
This commit refactors HttpMethod from a Java enum into a class. The
underlying reason being that HTTP methods are not enumerable, but
instead an open range and not limited to the predefined values in the
specifications.

Closes gh-27697
2021-11-30 13:44:36 +01:00
Brian Clozel e66095b1a2 Polish
Closes gh-27466
2021-11-25 22:03:11 +01:00
Daniel Le 6605953eb5 Optimize header removal in ForwardedHeaderFilter
The current implementation suggests that the request's headers are not
expected to change. Hence, it's not necessary to copy them.
Furthermore, it might be costly to do so if there are many headers.
Instead, cache only the request's header names for method getHeaderNames.

Methods getHeader and getHeaders delegate to the respective methods of
request if the header name is not in FORWARDED_HEADER_NAMES. Otherwise,
they return null or an empty Enumeration respectively.

See gh-27466
2021-11-25 21:40:21 +01:00
김보배(Bobae Kim)/Platform Engineering팀/11ST 804b343cab Use parseInt without substring method 2021-11-25 16:14:59 +01:00
Arjen Poutsma 259bcd60fb Change deprecated MimeType specificity usages
This commit changes all code that uses now deprecated methods in
MimeType and MediaType.

See gh-27580
2021-11-23 11:49:01 +01:00
Arjen Poutsma 6d9136013e Refactor MimeType/MediaType specificity
This commit makes several changes to MimeType and MediaType
related to the topic of specificity.

This commit deprecates the MimeType and MediaType Comparators.
Comparators require a transitive relationship, and the desired order for
these types is not transitive (see #27488).

Instead, this commit introduces two new MimeType methods: isMoreSpecific
and isLessSpecific, both of which return booleans. MediaType overrides
these methods to include the quality factor (q) in the comparison.

All MediaType sorting methods have been deprecated in favor of
MimeTypeUtils::sortBySpecificity.  This sorting method now uses
MimeType::isLessSpecific in combination a bubble sort algorithm (which
does not require a transitive compare function).

Closes gh-27580
2021-11-23 11:49:01 +01:00
Rossen Stoyanchev fe8d42ff59 Add JdkHttpClientResourceFactory
See gh-23432
2021-11-22 12:20:30 +00:00
Rossen Stoyanchev b3b50f8f4b Refactoring in the JDK HttpClient support
See gh-23432
2021-11-22 12:20:30 +00:00
Rossen Stoyanchev dcc7154641 Polishing contribution
See gh-23432
2021-11-22 12:20:30 +00:00
Julien Eyraud d930617442 JDK HttpClient connector for WebClient
See gh-21014
2021-11-22 12:20:30 +00:00
Arjen Poutsma 9d65ff73f9 Merge branch '5.3.x' 2021-11-19 12:38:06 +01:00
Arjen Poutsma 722ab25f27 Support empty file names in UriUtils::extractFileExtension
Closes gh-27639
2021-11-19 12:37:00 +01:00
Juergen Hoeller 4750a9430c Early removal of 5.x-deprecated code
Closes gh-27686
2021-11-18 09:18:06 +01:00
Juergen Hoeller b88ed7f4bb Update API version and package references for Jakarta EE 9
Closes gh-27689
See gh-25354
2021-11-17 12:39:23 +01:00
Juergen Hoeller 555807ea9c Update ServletContainerInitializer filename for Jakarta EE 9
Closes gh-27690
See gh-25354
2021-11-17 12:38:58 +01:00
Brian Clozel f3b83e7ad4 Merge branch '5.3.x' 2021-11-16 15:05:24 +01:00
d4ksn 29572600dc Ensure that references > MAX_REFERENCE_SIZE are not processed
This commit ensures that only HTML references of length <
MAX_REFERENCE_SIZE are considered as potential references. This check is
possible because reference longer than 10 digits are out of bounds for
Integers.

Closes gh-1249
2021-11-16 15:04:08 +01:00
Christoph Dreis 5c972fcc54 Use Charset variants of URLEncoder and URLDecoder methods 2021-11-10 16:12:11 +01:00
SungMin 32af39d6e6
Use 'toString(Charset)' instead of 'toString(String)' for encodings (#27646)
Co-authored-by: 홍성민(SungMin Hong)/Platform Engineering팀/11ST <devmonster@11stcorp.com>
2021-11-10 15:11:33 +01:00
Rossen Stoyanchev ec947065a9 Merge branch '5.3.x' into main 2021-11-09 10:23:14 +00:00
Rossen Stoyanchev c6ce65ef56 Polishing contribution
Closes gh-27623
2021-11-09 09:47:02 +00:00
happyWilliam0 b5743966d6 Improve efficiency of UrlPathHelper#getSanitizedPath
See gh-27623
2021-11-09 09:47:02 +00:00
Arjen Poutsma 1eb8c93689 Merge branch '5.3.x' 2021-11-03 15:03:31 +01:00
Arjen Poutsma 0c7e000250 Refactor Contents to DefaultParts
This commit moves the Contents abstraction into DefaultParts

See gh-27613
2021-11-03 15:02:12 +01:00
Arjen Poutsma a71f0eb267 Merge branch '5.3.x' 2021-11-02 16:21:16 +01:00
Arjen Poutsma 694db2273f Add Part::delete method
This commit introduces the Part::delete method, that deletes its
underlying storage.

Closes gh-27612
2021-11-02 16:15:44 +01:00