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

[BUG][Kotlin] java.lang.IllegalArgumentException: Unexpected char when using non-ascii chars in headers #20330

Closed
6 tasks
Djaler opened this issue Dec 14, 2024 · 0 comments · Fixed by #20331
Closed
6 tasks

Comments

@Djaler
Copy link
Contributor

Djaler commented Dec 14, 2024

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

ApiClient throws an exception when building request with header value that contains non-ascii characters. In our case this is uploaded file name.

openapi-generator version

7.10.0

OpenAPI declaration file content or url

Any spec with header parameters

Generation Details

Generator: kotlin
Library: jvm-okhttp4 (default)

Steps to reproduce

Try to fill header value with non-ascii string.

Related issues/PRs

Similar issue for java client: #9053

Suggest a fix

Okhttp Headers.Builder has a addUnsafeNonAscii method. We should add an option to use this method for specific clients.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant