Skip to content

Differently encoded URLs in self and first links #1525

@max-maurice

Description

@max-maurice

DESCRIPTION

In the links section of a response, the URL values for self and first are encoded differently.

STEPS TO REPRODUCE

  1. Request a resource and include a filter query, where one constant expression contains a space character: http://localhost/api/items?filter=equals(city,'New York')
  2. The response looks like this:
    {
        "data": [
        ],
        "links": {
            "first": "http://localhost/api/items?filter=equals(city,%27New York%27)",
            "self": "http://localhost/api/items?filter=equals(city,%27New%20York%27)"
        },
        "meta": {
            "docs": "/swagger/index.html"
        }
    }

EXPECTED BEHAVIOR

Links are encoded the same way in all link URLs, where a space character is output as %20 just like in the self field.

ACTUAL BEHAVIOR

Links in the first and next field, and presumably in others too, are not entirely url-encoded.

VERSIONS USED

  • JsonApiDotNetCore version: 5.5.1
  • ASP.NET Core version: .Net 7.0.15
  • Entity Framework Core version: 7.0.15
  • Database provider: SqlServer

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions