Commit Graph

3741 Commits

Author SHA1 Message Date
Sam Brannen
f8a5a8d7be Use modern language features in tests 2022-02-03 14:50:10 +01: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
dbeae27d3c Reduce build time by reducing shutdown wait period for Jetty tests 2022-01-29 12:41:39 +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
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
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
6b3052200a Skip "data:" lines without content
Closes gh-27923
2022-01-12 16:35:42 +01: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
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
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
df263d01b9 Use idiomatic AssertJ assertions for true, false, and null 2022-01-10 14:15:55 +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
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
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
6582787678 Apply resources after application HttpClient mapper
Closes gh-27749
2021-12-02 12:28:36 +00:00
Arjen Poutsma
722ab25f27 Support empty file names in UriUtils::extractFileExtension
Closes gh-27639
2021-11-19 12:37:00 +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
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
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
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
0416168d0e Fix bug in max header calculation in DefaultPartHttpMessageReader
This commit fixes a bug in the DefaultPartHttpMessageReader, in the
check for exceeding the maximum header size. Before this commit, the
entire buffer size was considered, thus triggering an exception even
though the max header limit was not exceeded. After this commit, we only
consider the size up until the end-of-header mark (CRLFCRLF).

Furthermore, this commit increases the default maximum header size to
10k, the same default as Commons File upload.

Closes gh-27612
2021-10-27 16:28:32 +02:00
Sam Brannen
a603779f33 Return previous value in UndertowHeadersAdapter's remove() method
Prior to this commit, UndertowHeadersAdapter's remove() method violated
the java.util.Map contract by always returning null.

This commit fixes this by returning the previous list stored under the
specified key, and otherwise returning null if no previous value was
present.

Closes gh-27592
2021-10-22 14:57:12 +02:00
Sam Brannen
ec3f857bda Polish contribution
See gh-27586
2021-10-21 12:40:10 +02:00
no-brand
b3eb1a2ad7 Improve example in Javadoc for HttpEntity
Closes gh-27586
2021-10-21 12:35:59 +02:00
Arjen Poutsma
a248a52575 Revert transitive MediaType comparators
The fix made for gh-27488 resulted in a change of the default order
of codecs. This commit reverts these changes, so that the previous
order is restored.

Closes gh-27573
2021-10-19 11:53:22 +02:00
Arjen Poutsma
2a3c9e403f Revert "Polishing"
This reverts commit bfa01b35df.
2021-10-19 10:16:27 +02:00
Rossen Stoyanchev
bad87be306 Fix checkstyle warning
See gh-27569
2021-10-18 17:04:11 +01:00
Smile
4978eeff7f Update Javadoc in DefaultResponseErrorHandler
Closes gh-27569
2021-10-18 16:26:48 +01:00
Rossen Stoyanchev
a178bbe86f DefaultResponseErrorHandler shows full error details
Closes gh-27552
2021-10-13 20:51:34 +01:00
Juergen Hoeller
b1c7f7d127 Polishing 2021-10-13 12:48:47 +02:00
Rossen Stoyanchev
e8f6cd10a5 Apply value formatting to resolved exceptions 2021-10-11 11:14:02 +01:00
Juergen Hoeller
87aaf5049b Polishing 2021-10-08 20:41:51 +02:00
Juergen Hoeller
4b01370f54 UriTemplateRequestEntity overrides equals/hashCode
Closes gh-27531
2021-10-08 20:41:18 +02:00
Sam Brannen
41ae9632d1 Upgrade to Checkstyle 9.0 and spring-javaformat 0.0.29
This commit upgrades the Gradle build to use Checkstyle 9.0 and
spring-javaformat 0.0.29 (which internally uses Checkstyle 8.45.1).

Closes gh-27520
2021-10-06 12:11:19 +02:00
Arjen Poutsma
c99210c01f Propagate Reactor Context when using FluxSink
This commit makes sure that the Reactor context from a given mono or
flux is propagated to the Flux returned by a FluxSink. This change
affects both DataBufferUtils::write and internal classes used by the
DefaultPartHttpMessageReader.

Closes gh-27517
2021-10-05 16:30:49 +02:00
Sam Brannen
48a507a993 Clean up warnings 2021-10-05 14:35:32 +02:00
Rossen Stoyanchev
e68219c1ac ResponseStatusExceptionHandler logs exception message only
No need to log the full exception for a resolved exception, and as the
comment suggests that it mirrors Spring MVC equivalent, which also
logs the message only.
2021-10-05 12:12:17 +01:00
Juergen Hoeller
49427b0c3c Upgrade to Apache Johnzon 1.2.14, Vavr 0.10.4, WebJars Locator 0.48, HtmlUnit 2.53 2021-10-02 12:08:09 +02:00
Sam Brannen
f0aa4f4857 Escape closing curly braces in regular expressions for Android support
PR gh-24470 introduced a regression for Android users by no longer
escaping closing curly braces in regular expressions.

This commit therefore partially reverts the changes made in 273812f9c5
for closing curly braces (`}`).

Closes gh27467
2021-10-01 10:35:28 +02:00
Arjen Poutsma
bfa01b35df Polishing
See gh-27488
2021-09-30 17:09:03 +02:00