Commit b96f2fd
Fix connection pool exhaustion from proxy requests (#292)
* Fix connection pool exhaustion from ?uri= proxy requests (#287)
- Add 30 s connectionRequestTimeout to both HTTP client builders in
Application so pool exhaustion fails fast instead of blocking forever
- Replace allMatch(HTMLMediaTypePredicate) with Request.selectVariant()
in ProxyRequestFilter so real browser Accept headers (text/html,
application/xml;q=0.9, */*;q=0.8) correctly trigger the early return,
leaving (X)HTML responses to the downstream handler and Varnish cache
- In client.xsl ldh:rdf-document-response, detect external ?uri= URIs
and replace-content on #content-body with bs2:Row rendering of the
fetched RDF instead of iterating stale home-page blocks
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Server-side condition
* Server-side progress bar
* Fix external URI proxy bypass and client-side rendering
- ProxyRequestFilter: use Core-only MediaTypes (no HTML) with combined
Model+ResultSet writable variant list; selectVariant==null is the sole
bypass signal so Accept:*/* correctly reaches the proxy instead of
falling through to the HTML handler
- Thread pre-computed Variant through all getResponse() overloads to
avoid a second selectVariant call inside Core's Response constructor
- client.xsl onsubmit: skip the XHTML round-trip for external URIs and
call PushState + RDFDocumentLoad directly, advancing the progress bar
to 66% between the two steps; fixes the double-click issue
- client.xsl ldh:rdf-document-response: respect the #layout-modes mode
selector for client-side rendered external resources; refactor the
duplicate id('content-body') lookup out of both xsl:choose branches
- ProxyRequestFilterTest: stub Request.selectVariant() to return a
non-null Variant so both tests reach the logic they exercise
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* ProxyRequestFilter: document HTML bypass rationale; cache MediaTypes instance
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* ProxyRequestFilter: clarify HTML bypass as resource exhaustion defence
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Make HTTP client connectionRequestTimeout configurable
Defaults to 30000 ms (via Dockerfile ENV). Passed through the
CATALINA_OPTS path (same as allowInternalUrls) to avoid exceeding
the ~30-param libxslt limit already reached by context.xsl.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Fix ProxyRequestFilter HTML bypass: check Accept header explicitly
Replace the selectVariant==null bypass with an explicit check for
non-wildcard text/html or application/xhtml+xml in the Accept header.
Browsers list these types explicitly (q=1.0) and get bypassed to the
app shell; API clients that send only */* reach the proxy.
The old approach (Core MediaTypes, selectVariant==null) failed for
browsers because their */*;q=0.8 wildcard matched RDF variants,
causing the proxy to return RDF instead of the (X)HTML app shell.
Add testHtmlAcceptBypassesProxy to cover the bypass path.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Fix ContentMode block rendering for proxied external resources
Proxied resources' ContentMode blocks (charts, maps) were querying the
local SPARQL endpoint instead of the remote one because ProxyRequestFilter
discarded all external response headers and ResponseHeadersFilter then
injected the local sd:endpoint Link.
- ApplicationFilter: register external ?uri= target in request context
(AC.uri property) as authoritative proxy marker
- ProxyRequestFilter: forward all Link headers from external response
- ResponseHeadersFilter: skip local sd:endpoint/ldt:ontology/ac:stylesheet
for proxy requests; removes now-unused parseLinkHeaderValues/getLinksByRel
- client.xsl (ldh:rdf-document-response): extract sd:endpoint from Link
header and store in LinkedDataHub.endpoint, mirroring acl:mode pattern
- functions.xsl (sd:endpoint()): return LinkedDataHub.endpoint when set,
fall back to local /sparql — no changes needed in view.xsl or chart.xsl
- CLAUDE.md: document the proxy/client-side rendering architecture
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Replace proxy-detection heuristics with ac:uri() / $ac:uri throughout
- ApplicationFilter: store external URI as AC.uri context property; strip ?uri= from UriInfo
- ProxyRequestFilter: read proxy target from AC.uri context property; bypass HTML requests
- XsltExecutableFilter: remove SYSTEM_ID_PROPERTY; XSLTWriterBase reads AC.uri directly
- XSLTWriterBase: pass $ac:uri to server-side XSLT when proxying
- layout.xsl: declare $ac:uri param; use it for export links and search input pre-fill
- document.xsl: remove proxy spinner branch from bs2:ContentBody
- client/functions.xsl: add ac:uri() function (dynamic read of ixsl:query-params()?uri);
ldh:base-uri() now calls ac:uri() instead of stale global $ac:uri
- client.xsl: drop global $ac:uri param; ldh:HTMLDocumentLoaded passes ldh:base-uri(.)
to ldh:RDFDocumentLoad after pushState so URL is already updated
- ProxyRequestFilterTest: update mocks to use AC.uri context property
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Add server-side ac:uri() function; refactor ActionBar templates into document.xsl
- Add ac:uri() server-side function to imports/default.xsl (mirrors acl:mode() pattern)
- Move ActionBarLeft/ActionBarMain/ActionBarRight/BreadCrumbBar/ModeList/MediaTypeList templates from layout.xsl to document.xsl
- Fix $effective-mode type error (xs:string → xs:anyURI) and simplify with [1] idiom
- Use ac:uri() instead of $ac:uri in MediaTypeList hrefs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent fdd5a72 commit b96f2fd
File tree
17 files changed
+644
-502
lines changed- platform
- src
- main
- java/com/atomgraph/linkeddatahub
- server/filter
- request
- response
- vocabulary
- writer
- webapp/static/com/atomgraph/linkeddatahub/xsl
- bootstrap/2.3.2
- client
- imports
- test/java/com/atomgraph/linkeddatahub/server/filter/request
17 files changed
+644
-502
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
95 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
96 | 116 | | |
97 | 117 | | |
98 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
| 113 | + | |
112 | 114 | | |
113 | 115 | | |
114 | 116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1037 | 1037 | | |
1038 | 1038 | | |
1039 | 1039 | | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
1040 | 1044 | | |
1041 | 1045 | | |
1042 | 1046 | | |
| |||
Lines changed: 21 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
| 217 | + | |
217 | 218 | | |
218 | 219 | | |
219 | 220 | | |
| |||
358 | 359 | | |
359 | 360 | | |
360 | 361 | | |
| 362 | + | |
| 363 | + | |
361 | 364 | | |
362 | 365 | | |
363 | 366 | | |
| |||
445 | 448 | | |
446 | 449 | | |
447 | 450 | | |
448 | | - | |
| 451 | + | |
449 | 452 | | |
450 | 453 | | |
451 | 454 | | |
| |||
709 | 712 | | |
710 | 713 | | |
711 | 714 | | |
712 | | - | |
713 | | - | |
714 | | - | |
715 | | - | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
716 | 719 | | |
717 | 720 | | |
718 | 721 | | |
| |||
1527 | 1530 | | |
1528 | 1531 | | |
1529 | 1532 | | |
1530 | | - | |
| 1533 | + | |
1531 | 1534 | | |
1532 | 1535 | | |
1533 | 1536 | | |
| |||
1592 | 1595 | | |
1593 | 1596 | | |
1594 | 1597 | | |
1595 | | - | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
1596 | 1603 | | |
1597 | 1604 | | |
1598 | 1605 | | |
| |||
1629 | 1636 | | |
1630 | 1637 | | |
1631 | 1638 | | |
1632 | | - | |
| 1639 | + | |
1633 | 1640 | | |
1634 | 1641 | | |
1635 | 1642 | | |
| |||
1688 | 1695 | | |
1689 | 1696 | | |
1690 | 1697 | | |
1691 | | - | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
1692 | 1703 | | |
1693 | 1704 | | |
1694 | 1705 | | |
| |||
1708 | 1719 | | |
1709 | 1720 | | |
1710 | 1721 | | |
1711 | | - | |
| 1722 | + | |
1712 | 1723 | | |
1713 | 1724 | | |
1714 | 1725 | | |
| |||
Lines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
111 | 127 | | |
112 | 128 | | |
113 | 129 | | |
| |||
0 commit comments