Permalink
Browse files

Improve @Path support by making it more robust

  • Loading branch information...
1 parent cfe7833 commit c59d49c55f1c90d8de251889e94d3555356331ad @jfarcand jfarcand committed Jun 14, 2011
@@ -233,7 +233,11 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl
final Path atMethod = method.getAnnotation(Path.class);
if (atMethod != null) {
- rawUrl.append(atMethod.value());
+ String value = atMethod.value();
+ if (rawUrl.toString().endsWith( "/" ) && value.startsWith( "/" )) {
+ value = value.substring( 1 );
+ }
+ rawUrl.append(value);
}
if (rawUrl.toString().trim().length() == 0) {
@@ -32,6 +32,7 @@
public abstract class SimpleProxyTest extends BaseTest {
+ @Path("/")
public static interface ProxyClient {
@Get

0 comments on commit c59d49c

Please sign in to comment.