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

Overriding 'Content-Type' header with lowercase header 'content-type' produces an erroneous curl command #2416

Closed
jcamiel opened this issue Feb 11, 2024 · 0 comments · Fixed by #2419
Assignees
Labels
bug Something isn't working
Milestone

Comments

@jcamiel
Copy link
Collaborator

jcamiel commented Feb 11, 2024

Hurl 4.2.0:

  • Implicit Content-Type => OK
POST http://localhost:8000
{
    "name": "Bob",
    "age": 30
}
HTTP 200
$ hurl test.hurl | grep curl
* Request can be run with the following curl command:
* curl --header 'Content-Type: application/json' --data $'{\n    "name": "Bob",\n    "age": 30\n}' 'http://localhost:8000'
  • Explicit "Content-Type" header on implicit => OK
POST http://localhost:8000
Content-Type: application/vnd.api+json
{
    "name": "Bob",
    "age": 30
}
HTTP 200
$ hurl test.hurl | grep curl
* Request can be run with the following curl command:
* curl --header 'Content-Type: application/vnd.api+json' --data $'{\n    "name": "Bob",\n    "age": 30\n}' 'http://localhost:8000'
  • Explicit "content-type" (pay attention to the case) header on implicit => KO
POST http://localhost:8000
content-type: application/vnd.api+json
{
    "name": "Bob",
    "age": 30
}
HTTP 200
$ hurl test.hurl | grep curl
* Request can be run with the following curl command:
* curl --header 'content-type: application/vnd.api+json' --header 'Content-Type: application/json' --data $'{\n    "name": "Bob",\n    "age": 30\n}' 'http://localhost:8000'

In the last case, there are two "Content-Type" headers: 'content-type: application/vnd.api+json' and 'Content-Type: application/json'

@jcamiel jcamiel added the bug Something isn't working label Feb 11, 2024
@jcamiel jcamiel added this to the 4.3.0 milestone Feb 11, 2024
@jcamiel jcamiel self-assigned this Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant