Skip to content

Instantly share code, notes, and snippets.

@josephdpurcell
Last active January 27, 2016 20:21
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 josephdpurcell/74f0ccf0b595fb460cd8 to your computer and use it in GitHub Desktop.
Save josephdpurcell/74f0ccf0b595fb460cd8 to your computer and use it in GitHub Desktop.
Ref 833 Hotfix for hyphen/dash auth headers issue
diff --git a/modules/restful_token_auth/src/Plugin/authentication/TokenAuthentication.php b/modules/restful_token_auth/src/Plugin/authentication/TokenAuthentication.php
index 331281a..9d33d7a 100644
--- a/modules/restful_token_auth/src/Plugin/authentication/TokenAuthentication.php
+++ b/modules/restful_token_auth/src/Plugin/authentication/TokenAuthentication.php
@@ -93,7 +93,7 @@ class TokenAuthentication extends Authentication {
// If we don't have a $key_name on either the URL or the in the headers,
// then check again using a hyphen instead of an underscore. This is due to
// new versions of Apache not accepting headers with underscores.
- if (empty($input[$key_name]) && $request->getHeaders()->get($key_name)->getValueString()) {
+ if (!$input[$key_name] && !$request->getHeaders()->get($key_name)->getValueString()) {
$key_name = str_replace('_', '-', $key_name);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment