You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had the rather unusual idea to encode URL route configuration in the consul key-value store.
So, the mapping of key to value would be route to service name, something like: "/v9/" => "other-backend"
As kv store key names are just URL path suffixes, I tried to URL-encode my slashes.
A key name of "%2Fv9%2F" seems to be URL-unescaped by consul and result in the key name "/v9/", which created a "directory" containing a single key using the uploaded value as its name.
While I can understand that "%2F" is un-escaped by consul before creating the key, using the uploaded value as the name of an empty key is somewhat strange.
A key name of "%252Fv9%252F" actually results in a key named "%2Fv9%2F" being created with the uploaded value as its value. Unfortunately, the API returns that key name without URL-escaping it first:
slackpad
added
type/bug
Feature does not function as expected
and removed
thinking
More time is needed to research by the Consul Contributors
labels
May 5, 2017
Hey,
I had the rather unusual idea to encode URL route configuration in the consul key-value store.
So, the mapping of key to value would be route to service name, something like:
"/v9/"
=>"other-backend"
As kv store key names are just URL path suffixes, I tried to URL-encode my slashes.
A key name of
"%2Fv9%2F"
seems to be URL-unescaped by consul and result in the key name"/v9/"
, which created a "directory" containing a single key using the uploaded value as its name.While I can understand that
"%2F"
is un-escaped by consul before creating the key, using the uploaded value as the name of an empty key is somewhat strange.A key name of
"%252Fv9%252F"
actually results in a key named"%2Fv9%2F"
being created with the uploaded value as its value. Unfortunately, the API returns that key name without URL-escaping it first:GET
ing the key returned above reults in a301
, since consul un-escapes"%2F"
into"/"
before looking up the key.The key redirected to does not exist:
Requesting that key using
"service/someservice/routes/%252Fv9%252F"
actually works.So, I guess, key components should be URL-escaped before returning them in the API.
The text was updated successfully, but these errors were encountered: