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

fix(config)!: change content_type from endpoint config #17

Merged
merged 2 commits into from
Feb 4, 2024

Conversation

shouya
Copy link
Owner

@shouya shouya commented Feb 4, 2024

Previously the content_type in endpoint config is used to enforce the interpretation of the request body in a certain content type. This feature is useful on some feeds that reports wrong content types.

Later I discovered that this feature is more generally needed. For example, in the upcoming merge filter, we may also want to assume the content_type for the merged source. So in this PR, I moved the content_type field from endpoint's config to the client's config. I also renamed it to assume_content_type to make it more clear.

BREAKING CHANGE: This change will break the existing configuration if you use content_type field in an endpoint. You need to update your endpoint config as follows:

# old
endpoints:
  - path: /foo
    source: http://website/feed.xml
    content_type: application/atom+xml
    filters: ...

# new
endpoints:
  - path: /foo
    source: http://website/feed.xml
    client:
      assume_content_type: application/atom+xml
    filters: ...

@shouya shouya merged commit 4bdbe8c into master Feb 4, 2024
2 checks passed
@shouya shouya deleted the assume-content-type-field-for-client branch February 4, 2024 10:48
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.

1 participant