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

bugfix: convert metainfo from http style to rpc style #16

Merged
merged 1 commit into from
Jun 19, 2024

Conversation

yukiiiteru
Copy link
Member

Motivation

In previous codes, metainfo does not have a uniform style, and it cannot work properly between different types of service.

Solution

We agree to use following rules:

  • For RPC, use uppercase letters and _ as separators when transmitting
  • For HTTP, use lowercase letters and - as separators when transmitting
  • For both protocols, use RPC style (uppercase with _) for storing keys of metainfo.

To implement this more elegantly, we defined a trait Converter and use it for converting the key names between transmitting format and storing format.

Unit tests are also updated.

@yukiiiteru yukiiiteru requested review from a team as code owners June 19, 2024 08:22
In previous codes, metainfo does not have a uniform style, and it
cannot work properly between different types of service.

We agree to use following rules:

- For RPC, use uppercase letters and `_` as separators when
  transmitting
- For HTTP, use lowercase letters and `-` as separators when
  transmitting
- For both protocols, use RPC style (uppercase with `_`) for storing
  keys of metainfo.

To implement this more elegantly, we defined a trait `Converter` and
use it for converting the key names between transmitting format and
storing format.

Signed-off-by: Yu Li <[email protected]>
@PureWhiteWu PureWhiteWu merged commit ed502ea into cloudwego:main Jun 19, 2024
9 checks passed
@yukiiiteru yukiiiteru deleted the bugfix/http-metainfo branch June 20, 2024 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants