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: include insensitive case to get content-type in header filters #11

Merged
merged 4 commits into from
Aug 22, 2023

Conversation

Thiagoojtds
Copy link

@Thiagoojtds Thiagoojtds commented Aug 16, 2023

Including validation to get content-type in different word cases

@@ -31,12 +31,12 @@ public function __construct($allowedExtensions)


public function applyHeaderFilter(array $headers) {
if(!array_key_exists('Content-Type', $headers) && count($headers['Content-Type']) > 0){
$contentType = $headers['Content-Type'][0] ?? $headers['content-type'][0] ?? null;

Choose a reason for hiding this comment

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

n tem problema acessar a primeira posição antes de validar se existe o Content-Type? a validação que tinha antes verificava isso

Copy link
Author

Choose a reason for hiding this comment

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

vou adicionar uma condição antes para verificar se existe o content-type mas a srgunda parte da condição anterior não fez sentido pra mim, ja que se não existir o content type não podemos verificar a quantidade de valores nesse campo

@jeansouzak jeansouzak merged commit be2306a into jeansouzak:master Aug 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.

5 participants