Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A function to get HTTP headers from the current client's HTTP request #54665

Closed
alexey-milovidov opened this issue Sep 15, 2023 · 2 comments · Fixed by #61820
Closed

A function to get HTTP headers from the current client's HTTP request #54665

alexey-milovidov opened this issue Sep 15, 2023 · 2 comments · Fixed by #61820
Assignees
Labels
feature warmup task The task for new ClickHouse team members. Low risk, moderate complexity, no urgency.

Comments

@alexey-milovidov
Copy link
Member

alexey-milovidov commented Sep 15, 2023

Use case

Obtain the relevant data when some application sends the data directly to ClickHouse without a separate backend.

CREATE TABLE test (something String DEFAULT getClientHTTPHeader('X-CloudFlare-WTF')) ...

Header names are case-insensitive. The function takes a constant String and returns a String.
Some headers such as X-ClickHouse-Password should be restricted.

Describe the solution you'd like

Save the header's map to ClientInfo, and then get it from the function.

@alexey-milovidov alexey-milovidov added feature warmup task The task for new ClickHouse team members. Low risk, moderate complexity, no urgency. labels Sep 15, 2023
@lingtaolf
Copy link
Contributor

Could you let me try this ?

@alexey-milovidov
Copy link
Member Author

@lingtaolf amazing, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature warmup task The task for new ClickHouse team members. Low risk, moderate complexity, no urgency.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants