Skip to content

Add TimeZone header support to REST API (#17344)#17387

Open
Lexert19 wants to merge 2 commits intoapache:masterfrom
Lexert19:f_timezone_header
Open

Add TimeZone header support to REST API (#17344)#17387
Lexert19 wants to merge 2 commits intoapache:masterfrom
Lexert19:f_timezone_header

Conversation

@Lexert19
Copy link
Copy Markdown

@Lexert19 Lexert19 commented Mar 29, 2026

Description

This PR adds support for the X-TimeZone header in REST API V2. The header is parsed in AuthorizationFilter and the time zone is set in the session. Integration tests are added to verify correct handling of valid and invalid time zones.

Closes #17344


This PR has:

  • been self-reviewed.
    • concurrent read
    • concurrent write
    • concurrent read and write
  • added documentation for new or modified features or behaviors.
  • added Javadocs for most classes and all non-trivial methods.
  • added or updated version, license, or notice information
  • added comments explaining the "why" and the intent of the code wherever would not be obvious
    for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold
    for code coverage.
  • added integration tests.
  • been tested in a test IoTDB cluster.

Key changed/added classes (or packages if there are too many classes) in this PR

@HTHou
Copy link
Copy Markdown
Contributor

HTHou commented Mar 30, 2026

Another question, why did you pick X-TimeZone? I found there is a document uses Time-Zone.
https://docs.github.com/en/rest/using-the-rest-api/timezones-and-the-rest-api?apiVersion=2026-03-10#using-the-time-zone-header

@HTHou
Copy link
Copy Markdown
Contributor

HTHou commented Mar 30, 2026

@Lexert19 Lexert19 force-pushed the f_timezone_header branch from dacddb6 to 4eb0e06 Compare April 3, 2026 12:17
@Lexert19
Copy link
Copy Markdown
Author

Lexert19 commented Apr 3, 2026

Hi @HTHou, thank you for the review! I've updated the PR:

  • Renamed header to Time-Zone
  • Added support to V1 and Table V1 API
  • Added examples
  • Added integration tests for V1 and V2, following the existing code style

@Lexert19 Lexert19 changed the title Add X-TimeZone header support to REST API (#17344) Add TimeZone header support to REST API (#17344) Apr 3, 2026
@Lexert19 Lexert19 force-pushed the f_timezone_header branch from 4eb0e06 to a286e68 Compare April 3, 2026 12:41
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.

[Feature request] RestAPI add set time zone

2 participants