Commit Graph

238 Commits

Author SHA1 Message Date
Greg Wilkins fac047905a suppress stack
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2022-08-12 08:31:49 +10:00
Ludovic Orban 08f344e7f6 add TODOs for Resource.combine
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-11 12:03:13 +02:00
Greg Wilkins 20bab8a471 Fix build 2022-08-11 16:34:10 +10:00
Greg Wilkins 8f8101ba81 fix #8448 warning on 304
Improved logging
2022-08-11 16:12:24 +10:00
Greg Wilkins 9833be0374 WIP #8441 isNotNormalWithinSelf
oops
2022-08-11 13:32:01 +10:00
Greg Wilkins fcdb8305de WIP #8441 isNotNormalWithinSelf
Added method to be optimized later
2022-08-11 12:52:19 +10:00
Greg Wilkins a0d6f42e73 Fix #8442 server propagation
Test setServer propagation
protect from inadvertent null setting
2022-08-11 09:05:12 +10:00
Joakim Erdfelt 842af3ed22
Avoid recreating `Resource` during container/jar pattern filtering in `MetaInfConfiguration`
* Delete PatternMatcher.java
2022-08-10 16:12:15 -05:00
Joakim Erdfelt 3b690fdefd
Adding in-code comments about Handler.setServer(Server) 2022-08-10 13:01:08 -05:00
Simone Bordet af77a53e39
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-08-10 16:51:35 +02:00
Jan Bartel 42f72268cf
Jetty 12 : #8408 Support new `<cookie-config>` concepts in Servlet 6 (#8420)
* Issue #8408 Implement new session cookie attributes
2022-08-10 16:33:08 +10:00
Greg Wilkins 408de26ec2 Created core-demo and updated demo root
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2022-08-10 12:04:39 +10:00
Joakim Erdfelt 199a9cd2ad
Jetty 12 : XML namespace cleanup (#8406)
* Adding Servlet 6 XML Entities
* Fixing bad xsi:schemaLocation entries
* Update all jetty-ee10 web XMLs to JakartaEE version 6.0 based
* Using XML Catalog
* Introducing catalogs for:
   - default XML xsd/dtd (catalog-org.w3.xml)
   - Configure dtd (catalog-configure.xml)
   - EE10 Servlet 6 xsd/dtd (catalog-ee10.xml)
   - EE9 Servlet 5 xsd/dtd (catalog-ee9.xml)
   - EE8 Servlet 4 xsd/dtd (catalog-ee8.xml)
* New XmlParser.addCatalog(URI catalogXml, Class<?> classBase)
   to allow the loading of a catalog which has it's resources
   referenced via the classBase.getResource(name)
* WebDescriptor uses Environment to load appropriate catalog.
* Remove XmlParser.redirectEntity(String, String)
2022-08-09 06:34:29 -05:00
Joakim Erdfelt e7e570f4bb
Invert merge hack from @Lachlan to return true on symbolic link 2022-08-08 11:41:11 -05:00
Ludovic Orban 871f1f8b4d Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-08 10:36:37 +02:00
Lachlan Roberts 19e2e7babc Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2022-08-08 16:15:53 +10:00
Joakim Erdfelt 21546e390c
Jetty 12 : Simplify `AnnotationParser` scanning for class files (#8404)
* Improved FileID.isHidden
* Simplified AnnotationParser
  + Not using MultiReleaseJarFile
  + Walk of a Directory or a JAR is the same
  + Reduced parse method count
  + Fixed TestAnnotationParser
     Using proper fully qualified classnames now (were not yet converted over to jetty-12 naming)
* Single parseClass method
* Single parseDir method
* Adapting ee9 AnnotationParser to have the same behaviors as ee10.
* Deleting TestAnnotationInheritance tests
  + We don't want the AnnotationParser
    creating new Resource objects for Class.getSuperClass()
    resources that don't belong to
    the same Resource that the passed
    in class belongs to (as this is out of
    scope for the Mount management).

    Imagine if told to parse ClassB
    which extends from ClassFoo, which
    is in a different JAR than ClassB?

    This concept from Jetty 9/10/11
    was only used in testcases and not
    in live runtime code, so it was
    removed.

Co-authored-by: Olivier Lamy <oliver.lamy@gmail.com>
2022-08-05 15:42:27 -05:00
Joakim Erdfelt fe21198499
Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-rework-resource-factory 2022-08-05 11:11:39 -05:00
Olivier Lamy d93ca33de9 fix it work
Signed-off-by: Olivier Lamy <oliver.lamy@gmail.com>
2022-08-05 21:55:34 +10:00
Joakim Erdfelt 3d60b558bf
Adding TODO about odd .setServer(Server) behavior 2022-08-04 14:45:14 -05:00
Joakim Erdfelt 05929ffe57
Move Favicon init to .setServer(Server) 2022-08-04 13:10:41 -05:00
Joakim Erdfelt 19039f4df8
Remove maxBuffer from ContentFactory.getContent(String) (#8403) 2022-08-04 17:32:50 +02:00
Simone Bordet 90fc840f43
Jetty 12 : Renamed FutureFormFields to just FormFields, as it is mostly used (#8411)
Renamed FutureFormFields to just FormFields, as it is mostly used
as a CompletableFuture, and the "Future" prefix is soo Java 5 :)

Improved releasing of chunks in FormFields implementation.

Improved configuration of FormFields for max number of fields and max form content length.

Fixed Field.toString().

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-08-04 17:18:13 +02:00
Lachlan e086cab807
Fixes #8211 - fix ISE from HttpChannelState if failure during process (#8215)
Now all the logic for completion is in lockedOnComplete().

Avoid throwing in ChannelCallback.succeeded() if HttpChannelState._error != null.
This is necessary because HttpChannelState._error may be set asynchronously by
some event such as HTTP/2 reset streams or idle timeouts, but if there is a
thread dispatched to the application the asynchronous event will not fail the
callback, as the failure may be noticed by the application (e.g. via a read() call).

Fixed TrailersTest.testHandlerRequestTrailers() by avoid reading again after
having read the trailers.

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2022-08-04 17:06:32 +02:00
Simone Bordet c077bbecaa
Jetty 12.0.x MultiPart (#8201)
Moved multipart test files to jetty-http.

Introduced jetty-http `MultiPart` class and made `MultiPart.Parser` non-blocking and lenient on newlines.
Made `MultiPartCaptureTest` to pass.

Moved o.e.j.server.MultiPartParserTest tests to o.e.j.http.MultiPartTest.

Renamed MultiPartFormInputStreamTest to MultiPartsTest.

Introduced class o.e.j.server.MultiParts, a CompletableFuture of Parts
that can be used asynchronously in Handlers and in general in core Jetty.

Implemented multi-part handling in ee10.

Implemented DelayedHandler.UntilMultiPart.

Introduced MultiPart.ContentSource as the multipart "generator".

Replaced ByteBuffer/boolean pair with Chunk and implement Chunk slicing & improve retainability for MultiPart parser.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2022-08-04 17:03:40 +02:00
Joakim Erdfelt d97ab506f7
Improved version based on review 2022-08-04 09:15:13 -05:00
Joakim Erdfelt 1f1b9dc2dc
Better handling of jetty-dir.css and favicon.ico 2022-08-04 08:37:56 -05:00
Joakim Erdfelt 74f54da67e
Adding FileSystemPool.Listener support 2022-08-04 07:38:29 -05:00
Ludovic Orban ecd2cabfa2 fix test
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-04 12:56:27 +02:00
Ludovic Orban 341adb4b62 tentatively fixing mount leaks
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-03 20:45:47 +02:00
Ludovic Orban ae56240423 restore getAlias
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-03 18:37:19 +02:00
Ludovic Orban a1e08ec56e improve javadoc
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-03 18:10:22 +02:00
Ludovic Orban 7a28563bcc move toURI to URIUtil
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-03 17:04:22 +02:00
Ludovic Orban 50c19d317b Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-rework-resource-factory 2022-08-03 17:00:24 +02:00
Ludovic Orban 5ca51c97ad hide ResourceFactory internals and cleanup Mount leftovers
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-03 16:59:02 +02:00
Ludovic Orban 7df3da2af8 handle review comments
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-03 16:30:02 +02:00
Ludovic Orban 2459e7a2cc fix compilation errors
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-03 14:12:23 +02:00
Joakim Erdfelt 6ce295ce7a
Remove static Resources.isContainedIn API 2022-08-03 06:59:17 -05:00
Ludovic Orban 96eba300ca fix test
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-03 13:41:44 +02:00
Ludovic Orban da3fef6d58 make of(Container container) remove the bean when the container is stopped
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-03 13:36:00 +02:00
Ludovic Orban cb348c8d15 rename of() -> combine()
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-03 13:06:32 +02:00
Ludovic Orban f2a20436d4 review of mountIfNeeded contract
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-03 13:03:18 +02:00
Ludovic Orban e0c9943f4d rename createResource -> create
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-03 13:01:35 +02:00
Ludovic Orban fbfed70fe1 restore ResourceFactory use
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-03 12:58:51 +02:00
Ludovic Orban dc3e7ca51e fix test
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-03 12:53:58 +02:00
Ludovic Orban 129be15f50 remove obsolete test
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-03 12:53:50 +02:00
Ludovic Orban fb0290c88a replace ROOT references with root()
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-03 12:51:57 +02:00
Ludovic Orban b3dbfad97d move newSystemResource to ResourceFactory
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-03 12:43:08 +02:00
Ludovic Orban abe2f3264a move newClassPathResource to ResourceFactory
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-03 12:23:49 +02:00
Ludovic Orban 44325b28d6 fix filesystem leaks
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-03 11:51:29 +02:00