Commit Graph

3795 Commits

Author SHA1 Message Date
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
Arjen Poutsma
0a9746e820 Merge branch '5.3.x' 2021-10-27 16:37:00 +02:00