Skip to content

Commit

Permalink
Added req.headers["accept-language"] debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
maxxcrawford committed Apr 22, 2020
1 parent dfe8495 commit 1d7a379
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions controllers/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ async function home(req, res) {
let isUserInExperiment = null;
let experimentBranchB = null;

const debugHeadersAcceptLanguage = req.headers["accept-language"];

if (EXPERIMENTS_ENABLED) {
const coinFlipNumber = Math.random() * 100;
experimentBranch = getExperimentBranch(req, coinFlipNumber);
Expand Down Expand Up @@ -55,6 +57,7 @@ async function home(req, res) {
csrfToken: formTokens.csrfToken,
experimentBranch,
experimentBranchB,
debugHeadersAcceptLanguage,
});
}

Expand All @@ -67,6 +70,7 @@ async function home(req, res) {
experimentBranch,
isUserInExperiment,
experimentBranchB,
debugHeadersAcceptLanguage,
});
}

Expand Down
2 changes: 1 addition & 1 deletion public/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ div.sprite {
bottom: 0;
left: 0;
z-index: 9999;
background: rgba(97, 28, 125, 0.73);
background: rgba(97, 28, 125, 0.9);
color: white;
padding: 1em 2em;
}
1 change: 1 addition & 0 deletions views/partials/debug.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<div class="float-debug">
<ul>
<li>EXPERIMENT_ACTIVE: {{EXPERIMENT_ACTIVE}} </li>
<li>req.headers["accept-language"]: {{debugHeadersAcceptLanguage}} </li>
<li>sessionStorage: <span id="debugSessionStorage"></span> </li>
<li>isUserInExperiment: {{isUserInExperiment}} </li>
<li>experimentBranch: {{experimentBranch}} </li>
Expand Down

0 comments on commit 1d7a379

Please sign in to comment.