Skip to content

[REQ] Add warning on headers with underscores #4217

@ybelenko

Description

@ybelenko

Is your feature request related to a problem? Please describe.

Already discussed a bit in #3658. Quote:

Apache and Nginx webservers avoid underscores in HTTP headers, so api_key header received as api-key. Refs: Cannot retrieve all request headers using PHP slim framework and Why underscores are forbidden in HTTP header names.

Describe the solution you'd like

Maybe we should add warnings when headers contains underscores. I would add this to DefaultCodegen. I've read somewhere that headers with underscores can cause server security problems.

Describe alternatives you've considered

We can add generator option to disable this warnings. This might be useful when user already configured Nginx/Apache to allow headers with underscores.

Additional context

cc @OpenAPITools/generator-core-team

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions