Skip to content

Representation conversion is performed even with Accept */* #1023

Closed

Description

@RubenVerborgh
cat "# Test" > markdown.md
curl -T markdown.md http://localhost:3000 -H "Content-Type: text/markdown"
curl http://localhost:3000/markdown.md -i -s -H "Accept: */*" | grep -i Content-Type

Expected behavior: no conversion is performed, because the client accepts anything
Actual behavior: Markdown to HTML conversion is performed

I'm surprised by the above behavior, because the same conversion is not performed with errors:

curl http://localhost:3000/404 -i -s | grep -i Content-Type

Follow-up on #1021

Activity

  1. added
    🐛 bug
    on Oct 22, 2021
  2. jvherweg commented on Oct 22, 2021

    @jvherweg
    Member

    This is caused by c0dac12

    The markdown converter will always trigger. I'm not sure why this was added but I remember there being an issue and this being a hotfix for this. The reason it doesn't trigger for errors is because those have to be converted to markdown first so don't trigger at that point.

  3. RubenVerborgh commented on Oct 22, 2021

    @RubenVerborgh
    MemberAuthor

    Hmm, but this is preceded by an IfNeededConverter?

  4. RubenVerborgh commented on Oct 22, 2021

    @RubenVerborgh
    MemberAuthor

    Ah no, line 16.

  5. jvherweg commented on Oct 22, 2021

    @jvherweg
    Member

    Just discovered that we documented the reason for this in #834

  6. changed the title [-]Representation conversion is peformed even with Accept */*[/-] [+]Representation conversion is performed even with Accept */*[/+] on Oct 22, 2021
  7. jvherweg commented on Nov 8, 2021

    @jvherweg
    Member

    Done in #1030. Will be part of v3.0.0 release.

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

Metadata

Metadata

Assignees

Labels

🐛 bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions