Server should partially encode Slug header values
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 563
- Forks
- 108
- Avg merge
- 4d 13h
- Merged PRs (30d)
- 3
Description
Servers MAY allow clients to suggest the URI of a resource created through POST, using the HTTP Slug header as defined in [RFC5023].
— 5.1 Resource Type Heuristics
The value supplied by a caller in the Slug header ends up an being an IRI path segment.
Because of this, implementations must deal with slug characters that would be invalid in a segment.
At least one implementation currently strips invalid characters.
I propose mandating that implementations percent encode offending characters if they honour the slug:
POST /container/
Slug: a/b
HTTP 201
Location: /container/a%2Fb
We should suggest that servers do not encode any other character but the ones illegal in path segments:
POST /container/
Slug: fancy-slug!
HTTP 201
Location: /container/fancy-slug!
The offending class of characters that should be encoded is anything outside of pchar (RFC 3986).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with section 5.1, Resource Type Heuristics, and compare its current Slug guidance with RFC 3986 section 3 and the RFC 5023 reference. Done means the specification clearly defines percent encoding for Slug characters outside pchar while leaving allowed characters such as “!” unchanged.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100