Skip to content

GH-1442: [JDBC] Harden hostnameOverride handling and tests - #1443

Open
jbonofre wants to merge 1 commit into
apache:mainfrom
jbonofre:GH-1442-hostname-override-followup
Open

jbonofre wants to merge 1 commit into
apache:mainfrom
jbonofre:GH-1442-hostname-override-followup

Conversation

@jbonofre

@jbonofre jbonofre commented Nov 4, 2026

Copy link
Copy Markdown
Member

Follow-up to #1363.

  • Don't copy hostnameOverride in the ArrowFlightSqlClientHandler.Builder copy constructor. The override is only valid for the original host and port, so a copied builder no longer carries it to another location by default. getStreams already sets it explicitly for each endpoint, so behavior is unchanged.
  • Trim ArrowFlightConnectionConfigImpl.getHostnameOverride() and return null for blank values, as its Javadoc says.
  • Record the :authority the server receives in ConnectionTlsHostnameOverrideTest. The plaintext test now checks that the connection's own host and port are sent, and a new test checks that the override replaces the whole authority and that a port can be included.
  • Document that the override replaces the port in :authority, and that a port can be included.

Closes #1442.

Follow-up to apache#1363.

- Don't copy `hostnameOverride` in the `ArrowFlightSqlClientHandler.Builder` copy constructor. The override is only valid for the original host and port, so a copied builder no longer carries it to another location by default. `getStreams` already sets it explicitly for each endpoint, so behavior is unchanged.
- Trim `ArrowFlightConnectionConfigImpl.getHostnameOverride()` and return `null` for blank values, as its Javadoc says.
- Record the `:authority` the server receives in `ConnectionTlsHostnameOverrideTest`. The plaintext test now checks that the connection's own host and port are sent, and a new test checks that the override replaces the whole authority and that a port can be included.
- Document that the override replaces the port in `:authority`, and that a port can be included.

Closes apache#1442.
@jbonofre jbonofre added the enhancement PRs that add or improve features. label Nov 4, 2026
@github-actions github-actions Bot added this to the 20.0.0 milestone Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement PRs that add or improve features.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[JDBC] Follow-ups to the hostnameOverride connection property

2 participants