Invalid HTTP/2 headers are now causing an error rather than being ignored.
HTTP2Flusher now catches HpackException.StreamException and generates a
RST_STREAM frame, rather than just closing the connection.
Modified HpackEncoder to throw HpackException in case of encoding failure.
Introduced HpackEncoder.validateEncoding (defaults true) so validation of
the headers can be disabled (useful for tests).
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Code cleanups and reformatting.
Fixed logic for SETTINGS frame replies: they are not subject to rate control.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Reduce the number of RateControl fields, instead using common field in
HeaderParser.
Avoid null checking rateControl by having a NO_RATE_CONTROL static
HPack does not emit field with empty header name.
Apply rate control to any header parsing issue resulting in
session/stream failure
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Fixes#250 - Implement HTTP CONNECT for HTTP/2.
Modified HTTP/2 implementation to support the CONNECT method.
Implemented semantic defined by RFC 8441.
Implemented section 8.3 of RFC 7540.
Introduced HTTP2Client.streamIdleTimeout.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Updated server-side to use direct/heap ByteBuffers based on
getters and setters in the relevant components.
Made HTTP/1.1, HTTP/2, and WebSocket use the same mechanism.
Removed unused obsoleted methods:
* EndPoint.isOptimizedForDirectBuffers()
* HttpTransport.isOptimizedForDirectBuffers()
* HttpOutput.Interceptor.isOptimizedForDirectBuffers()
* HttpChannel.useDirectBuffers()
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Removing Legacy Method Separators
* Restyling branch `jetty-9.4.x`
* Applying changes highlighted by checkstyle
* Applying XML restyling
* Fixing XML codestyle for IntelliJ
* Fixing XML style mistakes
* Revert "Applying XML restyling"
* Updating checkstyle for XML codestyle
* Reformatting pom.xml files
* Fixed empty string from line wraps
* Update intellij style to not do expression relative formatting. Reformatted code based on that.
* Increasing line split on Eclipse IDE Formatter to 512
* Restoring setting on internal default value.
+ IntelliJ will not export settings on things that set to their
internal default values.
We want to keep those values as a hedge against future default
value changes in future releases of IntelliJ.
* Fixing intellij codestyle
* do not allow single line simple methods
* misc checkstyle fixes
* re-exported with correct name and all values
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: Greg Wilkins <gregw@webtide.com>
+ Changing usages of JVM deprecated classes / methods as well
+ Cleaning up test cases and javadoc
+ Removing test methods that rely on deprecated and now removed concepts
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Reviewed module-info.java files.
For those that have a "requires static" added a comment about
why the dependency is optional.
Rearranged directives in alphabetical order.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Fixes#2978 - Add module-info to relevant Jetty modules.
Added module-info.java for Jetty modules that are not test modules.
Moved jetty-http test utility classes to new module "jetty-http-tools".
Removed generation of test-jar from websocket-core.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
HPack as specified allows for values to be opaque bytes, even though HTTP only allows ISO-8859-1 within a header.
This updates HPack, so that strings are converted to UTF-8 and then encoded as bytes iff non ISO-8859-1 characters are discovered.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
+ Changes needed for new Junit 5
+ Migrating from Vintage junit API to Jupiter junit API
+ Relies on SNAPSHOT jetty-test-helper
- this will be a formal release once this issue has been
resolved satisfactory
+ Have jenkins always pull latest SNAPSHOT for each build
+ Adding jetty.snapshots repository
+ Using surefire 2.22.0 per advice from junit
+ Ensuring <reuseForks>true</reuseForks> to work around issue junit-team/junit5#801
+ Disabling <forkMode>always</forkMode> in maven-surefire-plugin
due to bug https://github.com/junit-team/junit5/issues/801
+ OSGi tests must remain at vintage due to PaxExam
+ Moving from vintage TestingDir to jupiter WorkDir
+ Fixing imports to use jupiter, not vintage
+ Migrating vintage ExpectedException to jupiter assertThrows
+ Migrating vintage TestName to jupiter TestInfo
+ Migrating @RunWith(Parameterized.class)
to @ParameterizedTest with Argument Sources
+ Migrating assertTrue(val.contains(needle))
to assertThat(val, containsString(needle))
+ Aligning junit versions per recommendations from @sormuras
+ Adjusting parameter order change for assertEquals()
+ Test LifeCycle Annotation Migration
junit 4 | junit 5 / jupiter
------------ | -----------
@Before | @BeforeEach
@After | @AfterEach
@BeforeClass | @BeforeAll
@AfterClass | @AfterAll
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
now handling padding over 7 bits with Exception
throwing CompressionExceptions instead of StreamExceptions
fixed issue with non terminal encoded strings
Signed-off-by: lachan-roberts <lachlan@webtide.com>
When an entry that is too large for the dynamic table is added, the entire table should be evicted as per the RFC. Previously we were throwing a 431 Bad Message. This will require that the OP should retest #1134.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Defined missing status codes (removed old/wrong javadoc)
Changed use of 413 to 431
Received SETTINGS_MAX_HEADER_LIST_SIZE is set on hpack encoded and warning generated only for large responses.
+ HttpField.nameHashCode() fixed to actually be US-ASCII case
insensitive per documentation
+ Since removal of MetaData equals/hashcode, the comparison
of the MetaData and MetaData.Response is now done entirely
within the HpackTest