@@ -24,9 +24,9 @@ func (b *Base) PathParam(name string) string {
2424
2525// PathParamRaw returns the raw param in request path, eg: "/{var}" => "/a%2fb", then `var == "a%2fb"`
2626func (b * Base ) PathParamRaw (name string ) string {
27- // this check should be removed before 1.25 release
2827 if strings .HasPrefix (name , ":" ) {
29- panic ("path param should not start with ':'" )
28+ setting .PanicInDevOrTesting ("path param should not start with ':'" )
29+ name = name [1 :]
3030 }
3131 return chi .URLParam (b .Req , name )
3232}
@@ -38,10 +38,10 @@ func (b *Base) PathParamInt64(p string) int64 {
3838}
3939
4040// SetPathParam set request path params into routes
41- func (b * Base ) SetPathParam (k , v string ) {
42- // this check should be removed before 1.25 release
43- if strings . HasPrefix ( k , ":" ) {
44- panic ( "path param should not start with ':'" )
41+ func (b * Base ) SetPathParam (name , value string ) {
42+ if strings . HasPrefix ( name , ":" ) {
43+ setting . PanicInDevOrTesting ( "path param should not start with ':'" )
44+ name = name [ 1 :]
4545 }
46- chi .RouteContext (b ).URLParams .Add (k , url .PathEscape (v ))
46+ chi .RouteContext (b ).URLParams .Add (name , url .PathEscape (value ))
4747}
0 commit comments