Skip to content

content-type is set by default even for empty body #31

Closed as duplicate

Description

@mullermp

Generic request will supply a default content-type of application/x-www-form-urlencoded -

def supply_default_content_type

While this is helpful, this can have negative consequences, and we cannot disable the behavior. In cases where there is no body, or body is set and empty, the content-type is set. In these cases, content-type should not be set at all. It must be set to something to avoid the behavior.

So I'm opening this issue to start discussion. Is it possible that:

  1. Net::HTTP does not supply default content type for empty body?
  2. Is it ok to introduce an option on request to turn off this behavior?
  3. Net::HTTP default content type is application/octet-stream instead of application/x-www-form-urlencoded

Activity

  1. damienb-opt commented on Dec 3, 2024

    @damienb-opt

    That one was hard to track on our side, had to tcpdump to get a clue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions