Skip to content

Custom context for mux.Vars #187

@Southern

Description

@Southern

Is there a particular reason that varsKey and routeKey are using the contextKey type? https://github.com/gorilla/mux/blob/master/mux.go#L322-L327

This causes problems when attempting to use request.WithContext(context.WithValue(request.Context(), 0, map[string]string{...})) for testing route params because mux.Vars is looking for contextKey(0) as the key rather than int(0).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions