Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Transform reprefix into rewrite

  • Loading branch information...
commit a8bfd274d27a658630103b14f25b969d197e650e 1 parent a4d4a4e
@VictorNicollet authored
Showing with 3 additions and 5 deletions.
  1. +3 −5 src/action_Endpoint.ml
View
8 src/action_Endpoint.ml
@@ -19,12 +19,10 @@ let endpoint_of_controller (server,prefix,parse) =
( Server.server_root server s :: prefix ::
List.map (Netencoding.Url.encode ~plus:false) (Args.generate parse a))
-let reprefix f str sub s a =
+let rewrite f str sub s a =
let url = f s a in
- if BatString.starts_with url str then
- sub ^ BatString.tail url (String.length str)
- else
- str
+ let _, url = BatString.replace url str sub in
+ url
let setargs f a s () =
f s a
Please sign in to comment.
Something went wrong with that request. Please try again.