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

Content-Type Header Overwritten in patch_feature_flag_with_http_info Method #6

Open
nastyagrishina opened this issue Jul 26, 2024 · 1 comment

Comments

@nastyagrishina
Copy link

Description

There is an issue with the patch_feature_flag_with_http_info method in the LaunchDarkly API Client library. Even when the Content-Type header is provided, it gets overwritten, which causes the semantic patch requests to fail.

Steps to Reproduce

  1. Call the patch_feature_flag_with_http_info method to make a semantic patch request.
  2. Set the Content-Type header to application/json; domain-model=launchdarkly.semanticpatch.
  3. Observe that the Content-Type header does not retain the provided value and is instead set to application/json.

Expected Behavior

The Content-Type header should retain the provided value and include domain-model=launchdarkly.semanticpatch to comply with the LD API Docs for semantic patch requests.

Actual Behavior

The Content-Type header is overwritten to application/json, causing the request to fail.

Additional Information

I have created a pull request with proposed changes to address this issue. Please take a look: (#5)

Thank you!

@garrettblehm
Copy link

This is a problem for more than just the FeatureFlagsApi.

This code is present in all PATCH API operations:

content_type = @api_client.select_header_content_type(['application/json'])

if !content_type.nil?
  header_params['Content-Type'] = content_type
end

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

No branches or pull requests

2 participants