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

Add contains operator to ContentType objects #4433

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

osipxd
Copy link
Member

@osipxd osipxd commented Oct 29, 2024

Subsystem
Core

Motivation
Add a simple way to check if a content type has one of the well-known types. This check should be case-insensitive, that is why it is error-prone to check content type using contentType.startsWith(...)

Solution
Add an operator contains to ContentType objects checking that the content type prefix is equal to the expected type name ignoring its casing.

This is a draft PR to validate the idea.

@osipxd osipxd self-assigned this Oct 29, 2024
Copy link
Contributor

@bjhham bjhham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dig it 😎

@e5l e5l requested review from bjhham and removed request for e5l November 6, 2024 14:58
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.

2 participants