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

headers to lowercase #306

Merged
merged 1 commit into from
Dec 22, 2023
Merged

Conversation

chengxs1994
Copy link

@chengxs1994 chengxs1994 commented Dec 22, 2023

What:

  • Bug Fix
  • New Feature

Description:

Related:

@gehrisandro
Copy link
Collaborator

Hi @chengxs1994

Thank you for your PR!

Could you provide an example why this changes is necessary? As far as I understand the OpenAI docs, the headers should always be in lowercase.

@gehrisandro gehrisandro self-assigned this Dec 22, 2023
@huangdijia
Copy link

huangdijia commented Dec 22, 2023

According to the psr specification, the getHeaderLine method is case insensitive, but the conversion to array does not automatically convert to lowercase

https://www.php-fig.org/psr/psr-7/

While header names are not case-sensitive, getHeaders() will preserve the exact case in which headers were originally specified.

@gehrisandro
Copy link
Collaborator

Thanks for clarification 👍

@gehrisandro gehrisandro merged commit ec1dde4 into openai-php:main Dec 22, 2023
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