Skip to content

Instantly share code, notes, and snippets.

@ZhenDeng
Created November 14, 2019 12:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ZhenDeng/df94a3c3262d29c104a960237b5ac94e to your computer and use it in GitHub Desktop.
Save ZhenDeng/df94a3c3262d29c104a960237b5ac94e to your computer and use it in GitHub Desktop.
Request.Headers.TryGetValue("some-header-name", out var headers);
if(headers.Count > 1 || string.IsNullOrWhiteSpace(headers.FirstOrDefault())){
return new UnauthorizedResult();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment