Open xfra35 opened 7 years ago
This is a followup of #214.
When defining a route like GET /explorer/@path: should encoded slashes be allowed inside @path or not?
GET /explorer/@path
@path
E.g: /explorer/abc%2fdef.
/explorer/abc%2fdef
Background:
2.x
We need to decide:
Here are two suggestions for decoding UTF-8 characters while preserving encoded slashes:
// solution #1 (case sensitive) $req=urldecode(str_replace(['%2f','%2F'],['%252f','%252F'],$this->hive['PATH'])); // solution #2 (case insensitive) $req=implode('/',array_map(function($str){return str_replace('/','%2f',urldecode($str));},explode('/',$this->hive['PATH'])));
Why not a configurable hive variable (like PASSTHRU) so we can maintain backward comptibility and at the same time allow the dev to make that decision to override default behavior?
This is a followup of #214.
When defining a route like
GET /explorer/@path
: should encoded slashes be allowed inside@path
or not?E.g:
/explorer/abc%2fdef
.Background:
2.x
We need to decide:
Here are two suggestions for decoding UTF-8 characters while preserving encoded slashes: