|
From: Juri L. <no...@gi...> - 2026-07-20 17:13:46
|
Branch: refs/heads/develop Home: https://github.com/eXist-db/exist Commit: ce5ad350429a2f8cfbaee6398a89e8d544e25de7 https://github.com/eXist-db/exist/commit/ce5ad350429a2f8cfbaee6398a89e8d544e25de7 Author: Joe Wicentowski <jo...@gm...> Date: 2026-07-11 (Sat, 11 Jul 2026) Changed paths: M extensions/modules/http-client/src/main/java/org/exist/xquery/modules/httpclient/RequestBuilder.java M extensions/modules/http-client/src/test/java/org/exist/xquery/modules/httpclient/SendRequestFunctionTest.java Log Message: ----------- [bugfix] http-client: honor http:body/@method for inline body serialization The native EXPath HTTP Client ignored the @method attribute on http:body, so an inline body could only be XML-serialized or sent as text -- a binary/base64/hex inline body could not be sent at all (only http:body/@src, added in #6510/#6511, delivered raw bytes). RequestBuilder now honors @method (EXPath HTTP Client 3.1): - binary / base64: the body's content is base64-decoded and sent as raw bytes. - hex: the content is hex-decoded and sent as raw bytes. - text: the content's string value is sent (an element child is serialized as its text, not its markup). - xml / xhtml / html (or no @method): unchanged -- child elements are XML-serialized as before. Malformed base64/hex content raises err:HC005. The string value of body content is computed by an explicit recursive walk, because the in-memory DOM's getTextContent does not recurse into element children of a constructed http:body. Multipart-part @method, JSON/adaptive serialization, and multiple external $bodies remain follow-ups (#6512). SendRequestFunctionTest gains bodyMethodBinarySendsDecodedBytes, bodyMethodHexSendsDecodedBytes, and bodyMethodTextSerializesAsText. Part of https://github.com/eXist-db/exist/issues/6512 Co-Authored-By: Claude Opus 4.8 (1M context) <no...@an...> Commit: b5ebd706f8ef2da903b58584f2c69f4495d62fab https://github.com/eXist-db/exist/commit/b5ebd706f8ef2da903b58584f2c69f4495d62fab Author: Joe Wicentowski <jo...@gm...> Date: 2026-07-11 (Sat, 11 Jul 2026) Changed paths: M extensions/modules/http-client/src/main/java/org/exist/xquery/modules/httpclient/RequestBuilder.java M extensions/modules/http-client/src/test/java/org/exist/xquery/modules/httpclient/SendRequestFunctionTest.java Log Message: ----------- [refactor] Address review: switch expression for isRawContentMethod Per @reinhapa's review of PR #6513: - Rewrite isRawContentMethod as a switch expression for readability. The bare switch would NPE on a null selector, so it uses a `case null, default` label -- the prior `||`-of-`equals` chain was implicitly null-safe, and bodyMethod is null whenever http:body has no @method attribute (the common case). Without the guard, every body lacking @method threw a NullPointerException ("Cannot invoke String.hashCode()"). - Convert the three new bodyMethod* test query strings to text blocks with formatted(baseUrl()). Co-Authored-By: Claude Opus 4.8 (1M context) <no...@an...> Commit: b8f8c5bb3513134df385757002100bc84d800eae https://github.com/eXist-db/exist/commit/b8f8c5bb3513134df385757002100bc84d800eae Author: Joe Wicentowski <jo...@gm...> Date: 2026-07-11 (Sat, 11 Jul 2026) Changed paths: M extensions/modules/http-client/src/main/java/org/exist/xquery/modules/httpclient/RequestBuilder.java Log Message: ----------- [refactor] http-client: make bodyPublisherForMethod fall-through an explicit else Address review feedback (dizzzz): the text/xml/xhtml/html (or no @method) default was a bare fall-through after two guard-clause ifs. Restructure the three cases into if / else if / else so the default is clearly the mutually-exclusive final branch, with a comment naming it. No behavior change. Co-Authored-By: Claude Opus 4.8 <no...@an...> Claude-Session: https://claude.ai/code/session_01ThoADnh6VvDt5w8kz7d2d3 Commit: e622ebe344f4859c9fb7345225c2ec591eef72d9 https://github.com/eXist-db/exist/commit/e622ebe344f4859c9fb7345225c2ec591eef72d9 Author: Joe Wicentowski <jo...@gm...> Date: 2026-07-15 (Wed, 15 Jul 2026) Changed paths: M extensions/modules/http-client/src/main/java/org/exist/xquery/modules/httpclient/RequestBuilder.java Log Message: ----------- [refactor] http-client: convert bodyPublisherForMethod to a switch expression The four-way http:body/@method dispatch for the single-body publisher reads more clearly as a switch expression than an if/else chain, per PR review feedback. binary/base64 and hex keep dedicated arms that decode to raw bytes; text/xml/xhtml/html and no @method share the `case null, default` arm that serializes to a string in the media-type's charset, mirroring the adjacent isRawContentMethod switch. Co-Authored-By: Claude Opus 4.8 (1M context) <no...@an...> Commit: 30ae48532e57a83662666e6e09910bd67e4102f2 https://github.com/eXist-db/exist/commit/30ae48532e57a83662666e6e09910bd67e4102f2 Author: Juri Leino <gi...@li...> Date: 2026-07-20 (Mon, 20 Jul 2026) Changed paths: M extensions/modules/http-client/src/main/java/org/exist/xquery/modules/httpclient/RequestBuilder.java M extensions/modules/http-client/src/test/java/org/exist/xquery/modules/httpclient/SendRequestFunctionTest.java Log Message: ----------- Merge pull request #6513 from joewiz/bugfix/http-client-body-method [bugfix] http-client: honor http:body/@method for inline body serialization Compare: https://github.com/eXist-db/exist/compare/193c3765233f...30ae48532e57 To unsubscribe from these emails, change your notification settings at https://github.com/eXist-db/exist/settings/notifications |