Skip to content

bug: headers map can be nil#1650

Merged
SpencerTorres merged 1 commit intoClickHouse:mainfrom
r0bobo:fix-http-protocol-header-nil-pointer
Sep 12, 2025
Merged

bug: headers map can be nil#1650
SpencerTorres merged 1 commit intoClickHouse:mainfrom
r0bobo:fix-http-protocol-header-nil-pointer

Conversation

@r0bobo
Copy link
Copy Markdown
Contributor

@r0bobo r0bobo commented Sep 11, 2025

Summary

The func (h *httpConnect) createRequestWithExternalTables(ctx context.Context, query string, options *QueryOptions, headers map[string]string) (*http.Request, error) function assumes that the headers map passed into is instantiated.
When testing the http protocol in our system we get panic: assignment to entry in nil map when doing writes.

This change instantiates the map if it's empty to avoid that.

Checklist

Delete items not relevant to your PR:

  • A human-readable description of the changes was provided to include in CHANGELOG

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Sep 11, 2025

CLA assistant check
All committers have signed the CLA.

@r0bobo r0bobo force-pushed the fix-http-protocol-header-nil-pointer branch from 1c86c9a to 01eb24e Compare September 11, 2025 09:58
@SpencerTorres SpencerTorres merged commit b908b0a into ClickHouse:main Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants