Repository navigation
v3.3.0
·
68 commits
to master
since this release
Immutable
release. Only release title and notes can be modified.
Security
TdjWebComponentHandler.InvokeService's 500 response no longer discloses
the component class name, the exception class name, or the exception
message by default — the body is now generic
(500 Internal Server Error) unlessDARAJA_PROJECT_STAGE_DEVELOPMENTis
defined, matching the existing gating of the stack-trace block. The full
detail (component/exception class and message, plus stack trace when
available) is now always logged server-side via the framework logger,
regardless of what the client response discloses. (#520)TdjHTTPServer.MyOnExceptionandTdjHTTPConnector.OnCommandnow log a
malformed request line (EIdHTTPErrorParsingCommand) and a client that
dribbles or never finishes a request (EIdReadTimeout, e.g. Slowloris) at
Debuginstead ofWarn/Error, since spraying malformed requests could
otherwise inflate the log volume for free. Every other exception keeps its
existing level. (#521)TdjHTTPConnector.OnCommandleftResponseNoat-1when it swallowed an
exception from request handling, which depending on Indy's handling of an
invalid status could send the client an empty or malformed response
instead of a clean 500. It now setsResponseNo := 500with the same
generic, detail-free body asTdjWebComponentHandler.InvokeService's
default error page. (#517)- The request target is now normalized once, centrally, before routing:
.,..and repeated/are collapsed by path segment, and a
Servlet-style;-parameter is stripped, before a filter's or component's
URL pattern is matched against it. A target carrying an embedded NUL or
other raw control byte is rejected with400instead of reaching
routing. This also fixes a real bypass:TdjWebComponentHandler.Handle
used to match a filter's prefix pattern against the raw,
context-prefixed target while matching the guarded component against the
context-stripped path, so a prefix-pattern filter (e.g./secure/*)
silently never applied on any non-root context. (#530)
Added
TdjWebComponentHolder.LoadOnStartup: an integer property, mirroring the
Servlet spec'sload-on-startupelement, that controls the order in which
Web Components are initialized when their context starts — lower values
first, ties (including the default, 0) broken by registration order. (#492)- A negative
LoadOnStartupnow defers initialization of a Web Component
until the first request that matches it, instead of starting it eagerly at
context start. Concurrent first requests are safe (only one triggers
Init); if thatInitraises, the triggering request gets a500
response and the component is retried, not permanently unavailable, on the
next request. (#496) TdjWebComponent.OnGetETag: an overridable method, alongside
OnGetLastModified, that lets a Web Component supply an ETag for
conditional GET/HEAD. When a request carriesIf-None-Match, it alone
decides whether the response is304 Not Modified, per RFC 7232 Section
3.3;If-Modified-Sinceis only consulted when the request has no
If-None-Match. Matching is weak (a leadingW/is ignored on either
side), andIf-None-Match: *matches any current representation. (#430)
Changed
TdjWebComponent.OnOptionsnow defaults to200with anAllowheader
listing the HTTP methods the component supports (i.e. theOn*handlers it
overrides, plus the impliedHEAD), and no response body, instead of
405 Method Not Allowed. A405response — whether from a not-overridden
handler or set explicitly — now also carries the sameAllowheader. (#429)- Replaced the single
EWebComponentExceptionwith an exception hierarchy:
EDarajaExceptionis now the common base, withEDarajaConfigException,
EDarajaMappingExceptionandEDarajaLifecycleExceptionfor configuration,
registration/mapping and lifecycle errors respectively, so callers can
distinguish the cause of a failure.EWebComponentExceptionis removed;
code catching it should catchEDarajaExceptionor one of the specific
subclasses instead. (#435)
Fixed
TdjLifeCycle.Startcould runDoStarttwice for the same instance when
two threads calledStartconcurrently before either had finished; it now
re-checks the started state after acquiring its lock. (#496)- A
TdjWebComponent.Initexception duringTdjWebComponentHolder.DoStart
was swallowed, leaving the holder marked as started with a half-initialized
component instead of stopped; it now propagates so the holder is correctly
left not started. (#496) - A
304 Not Modifiedresponse fromTdjWebComponent's conditional GET/HEAD
handling omitted theDateandLast-Modifiedheaders that a200
response to the same request would have carried; it now sends both (and
ETag, if the component supplies one), per RFC 7232 Section 4.1. (#430) - A failed
TdjLifeCycle.StartleftFStarted/FStoppedat their
pre-Startvalues without undoing whateverDoStarthad partially started
(e.g. connectors already bound before a later one failed), soDestroy's
if IsStarted then Stopnever reached them and they leaked for the
lifetime of the process.Startnow best-effort rolls back viaDoStopon
aDoStartfailure before re-raising the original exception. (#498) TdjStatisticsFilter.DoFilterdereferencedRequest.Session.Content
unconditionally, so a context without auto-sessions enabled (or a client
with no session cookie) crashed with an access violation on every
request. It now raises a clearEDarajaConfigExceptionexplaining that
the filter's context must be created with sessions enabled, instead of
AVing. (#516)
Internal
HTTPTestCase(test helper base class): extracted the URL-normalization
logic duplicated across nearly everyCheck*method intoResolveURL,
and thehoNoProtocolErrorExceptiontoggle duplicated across nine methods
intoAllowErrorResponseCodes. No behavior change. (#509)- New test coverage:
TdjHandlerCollection's per-handler exception isolation
onStart/Handle, and its start/stop-on-mutation behavior in
AddHandler/RemoveHandler;TdjContextHandler.ContextMatches'
path-prefix and connector-name whitelist matching. (#501) TdjWebComponentandTdjWebFilterdoc comments now spell out the
single-instance threading contract (one instance per registered
component/filter, shared across all concurrent request threads — do not
keep per-request state in instance fields); the getting-started guide's
"Web Components and multi-threading" section was fixed (a broken code
example) and expanded to match. (#513)TdjPathMap.Matches's unreachablestUnknownbranch now asserts (debug
builds only, via{$IFDEF DEBUG}) instead of raising a bareException,
so a future bug here would surface as a routing 404 rather than an
uncaught exception turning into a 500. No behavior change: registration
already rejectsstUnknownpatterns (#422), so the branch stays
unreachable in practice. (#519)- Version constant set to
3.3.0. (#515)