Skip to content

spp_api_v2: Location headers of POST /Individual, POST /Group and $split contain an unencoded '#' #563

Open

Description

@gonzalesedwin1123

Problem

Location is built as /api/v2/spp/Individual/{system}|{value} with the raw system URI
(urn:openspp:vocab:id-type#national_id). The # starts a URL fragment, so a client following the header requests
…/Individual/urn:openspp:vocab:id-type and gets 400/404.

  • spp_api_v2/routers/individual.py (create, ~348)
  • spp_api_v2/routers/group.py (create ~305, $split ~901)

PR #555 fixed the same defect for POST /ProgramMembership (_membership_location: URL-encode the system and value).

Proposal

URL-encode the identifier in these Location headers (shared helper), with tests that follow the returned Location.

Context

Found in the adversarial review of PR #555 (#554).

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions