Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Transform reprefix into rewrite

  • Loading branch information...
commit a8bfd274d27a658630103b14f25b969d197e650e 1 parent a4d4a4e
Victor Nicollet authored

Showing 1 changed file with 3 additions and 5 deletions. Show diff stats Hide diff stats

  1. +3 5 src/action_Endpoint.ml
8 src/action_Endpoint.ml
@@ -19,12 +19,10 @@ let endpoint_of_controller (server,prefix,parse) =
19 19 ( Server.server_root server s :: prefix ::
20 20 List.map (Netencoding.Url.encode ~plus:false) (Args.generate parse a))
21 21
22   -let reprefix f str sub s a =
  22 +let rewrite f str sub s a =
23 23 let url = f s a in
24   - if BatString.starts_with url str then
25   - sub ^ BatString.tail url (String.length str)
26   - else
27   - str
  24 + let _, url = BatString.replace url str sub in
  25 + url
28 26
29 27 let setargs f a s () =
30 28 f s a

0 comments on commit a8bfd27

Please sign in to comment.
Something went wrong with that request. Please try again.