Skip to content

Commit

Permalink
Merge pull request #20 from jabbera/userRequestedFixed
Browse files Browse the repository at this point in the history
Don't send header if email or groups are null or empty
  • Loading branch information
jabbera authored May 20, 2017
2 parents 32ba3ea + 04a4aed commit 4cf96da
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions RutaHttpModule/RutaModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,15 @@ private void HandleAuthorizeRequestInternal(IRutaHttpContext context)
context.RemoveRequestHeader("Authorization"); // Remove the authorzation header since we are in charge of authentication
context.AddRequestHeader(this.settings.LoginHeader, loginToSend);
context.AddRequestHeader(this.settings.NameHeader, name);
context.AddRequestHeader(this.settings.EmailHeader, email);
context.AddRequestHeader(this.settings.GroupsHeader, string.Join(",", groupsToSend));
if (!string.IsNullOrWhiteSpace(email))
{
context.AddRequestHeader(this.settings.EmailHeader, email);
}

if (groupsToSend?.Length > 0)
{
context.AddRequestHeader(this.settings.GroupsHeader, string.Join(",", groupsToSend));
}
}

private (string login, string name, string email, string[] groups) GetUserInformation(string userName)
Expand Down

0 comments on commit 4cf96da

Please sign in to comment.