Permalink
Browse files

Multi Get requests are already authenticated (and always within the s…

…ame db)
  • Loading branch information...
1 parent b332061 commit e2b03187fa4fa1ce475ed7684f7d0d9dd2431d5b @ayende ayende committed Sep 1, 2011
@@ -111,6 +111,11 @@ public GetResponse Complete()
return getResponse;
}
+ public bool RequiresAuthentication
+ {
+ get { return false; }
+ }
+
public IRavenHttpConfiguration Configuration
{
get { return configuration; }
@@ -50,6 +50,11 @@ private void SetMaxAge()
context.Response.Cache.SetMaxAge(TimeSpan.FromSeconds(timeInSeconds));
}
+ public bool RequiresAuthentication
+ {
+ get { return true; }
+ }
+
public IRavenHttpConfiguration Configuration
{
get { return configuration; }
@@ -48,6 +48,11 @@ private void SetMaxAge()
ctx.Response.AddHeader("Cache-Control", "max-age=" + timeInSeconds);
}
+ public bool RequiresAuthentication
+ {
+ get { return true; }
+ }
+
public IRavenHttpConfiguration Configuration
{
get { return configuration; }
@@ -12,6 +12,7 @@ namespace Raven.Http.Abstractions
{
public interface IHttpContext
{
+ bool RequiresAuthentication { get; }
IRavenHttpConfiguration Configuration { get; }
IHttpRequest Request { get; }
IHttpResponse Response { get; }
View
@@ -387,7 +387,8 @@ private bool DispatchRequest(IHttpContext ctx)
CurrentOperationContext.Headers.Value = ctx.Request.Headers;
- if (requestAuthorizer.Authorize(ctx) == false)
+ if (ctx.RequiresAuthentication &&
+ requestAuthorizer.Authorize(ctx) == false)
return false;
try

0 comments on commit e2b0318

Please sign in to comment.