Module: Docker::API::Path
- Defined in:
- lib/docker/api/path.rb,
sig/docker/api/core.rbs
Overview
Escaping for values interpolated into a request path.
Constant Summary collapse
- SAFE =
Characters that may appear unescaped in a path. This is RFC 3986's
pcharset plus the separator itself.Keeping "/" and ":" unescaped is the point. Image references are
registry.example.com/team/image:tag, and the daemon's router matches those slashes as path structure -- percent-encoding them turns a valid reference into a 404. Everything genuinely unsafe (spaces, "?", "#", "%") is still escaped. %r{[^A-Za-z0-9\-._~!$&'()*+,;=:@/]}
Class Method Summary collapse
-
.escape(value) ⇒ String
The value, safe to place in a path.
Class Method Details
.escape(value) ⇒ String
Returns the value, safe to place in a path.
28 29 30 |
# File 'lib/docker/api/path.rb', line 28 def escape(value) URI::DEFAULT_PARSER.escape(value.to_s, SAFE) end |