From 8be3365c55cb59adc3a9f72a0cd0305b7e2b511b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chaloupka?= Date: Sat, 31 Dec 2016 14:30:22 +0100 Subject: [PATCH] Fix #1648 - ignore authorization in RestInterfaceClient --- web/vibe/web/internal/rest/common.d | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/web/vibe/web/internal/rest/common.d b/web/vibe/web/internal/rest/common.d index 6f11b562c9..47cdc1a1e8 100644 --- a/web/vibe/web/internal/rest/common.d +++ b/web/vibe/web/internal/rest/common.d @@ -250,7 +250,9 @@ import std.meta : anySatisfy, Filter; StaticRoute[routeCount] ret; - alias AUTHTP = AuthInfo!TImpl; + static if (is(TImpl == class)) { + alias AUTHTP = AuthInfo!TImpl; + } foreach (fi, func; RouteFunctions) { StaticRoute route; @@ -290,9 +292,14 @@ import std.meta : anySatisfy, Filter; } // determine parameter source/destination - if (is(PT == AUTHTP)) { - pi.kind = ParameterKind.auth; - } else if (IsAttributedParameter!(func, pname)) { + static if (is(TImpl == class)) { + if (is(PT == AUTHTP)) { + pi.kind = ParameterKind.auth; + } + } + + if (pi.kind == ParameterKind.auth) {} + else if (IsAttributedParameter!(func, pname)) { pi.kind = ParameterKind.attributed; } else static if (anySatisfy!(mixin(CompareParamName.Name), WPAT)) { alias PWPAT = Filter!(mixin(CompareParamName.Name), WPAT);