Repository navigation
Conversation
…ing the ack
When the bridge sends a request event whose payload cannot be constructed
into a Request, the throw previously escaped the event listener unanswered,
so the bridge burned its full timeout and reported a malformed URL as
repeater unavailability, flooding Sentry with Invalid URL. errors.
requestReceived now wraps only the construction step and, on failure, acks
the bridge with a { protocol, protocolError: { code, message } } variant —
distinct from an execution failure, which keeps its existing { message,
errorCode } reply. The rejection is a logger.error, not a captureException,
so these stop being Sentry events. The command hub is not invoked for a
payload that could not be constructed.
…e path Replace the two disagreeing URL parsers on the request-execute path with a single string-only TargetUrl decomposition that never throws: - transformScript and handleResponseScript no longer call new URL(), which used to throw on an authority defect and short-circuit an otherwise deliverable request into ERR_INVALID_URL before libcurl ever saw it. - configureCurl, resolveProxy and shouldApplyKerberos drop the legacy node:url parse(); all five consumers now share TargetUrl and agree on one behaviour for an unparseable authority (undefined hostname => skip virtual script, response script, proxy and Kerberos). - Hostnames are raw-lowercased with no IDNA/punycode (behaviour change for internationalised domains in virtual-script and proxy-domain matching). - The raw path is preserved byte-for-byte (PATH_AS_IS), carried over from the former buildRawPath.
Probe the six authority defects the WHATWG parser used to reject. Each now travels through TargetUrl to libcurl and is answered with a returned Response carrying libcurl's CURLE_URL_MALFORMAT failure — never a throw, never a hang, and never the client-side ERR_INVALID_URL short-circuit. This pins the observed behaviour on the supported Node runtime (engines: >=22 <=24) as a regression guard for the predicate relaxation.
Drop the WHATWG new URL() gate from Request. bright-cli and the bridge now agree on which URLs are deliverable: any non-blank (after trim) URL is accepted and travels to libcurl, so no shape the bridge dispatches is fatal in the CLI constructor. The one surviving rejection — a blank URL — carries the offending value through a userinfo-redacting formatter so credentials never reach logs or Sentry. Also update the malformed-payload launcher tests to use a blank URL, the only shape that still fails construction after this relaxation.
SummaryA This change makes an undeliverable URL a structured, immediate answer and lets every deliverable URL reach libcurl. What changed
Intentional behaviour changeHostnames are now raw-lowercased with no IDNA/punycode conversion. Virtual-script matching and proxy-domain matching therefore key on the raw hostname ( libcurl malformed-URL contract (verified)Probed on the supported runtime ( Verification
|
…request ack Replace the ad-hoc 'ERR_MALFORMED_REQUEST' string with a new RepeaterErrorCodes.MALFORMED_REQUEST enum member, so the per-request protocolError ack code is drawn from the same enum as the other repeater error codes. The value is carried on the request ack only, never on the deploy-time error event, so it does not affect critical-error handling.
|
Rename Request.validateUrl to assertUrlNotBlank: the only check left is rejecting a blank url.
Remove D3/D4 decision labels, finding and task references, and comments that restate the code. Flatten TargetUrl.spec nested describes to method names.
No description provided.