Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scratch-www
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
scratch-www
Commits
47a08e7d
Unverified
Commit
47a08e7d
authored
Dec 04, 2018
by
chrisgarrity
Committed by
GitHub
Dec 04, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2373 from chrisgarrity/issue/2236-tipbar-redirect
Add tip_bar fastly config
parents
ef64ccb3
39a3af87
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
bin/configure-fastly.js
bin/configure-fastly.js
+37
-0
No files found.
bin/configure-fastly.js
View file @
47a08e7d
...
...
@@ -171,6 +171,43 @@ async.auto({
if
(
err
)
return
cb
(
err
);
cb
(
null
,
headers
);
});
}],
tipbarRedirectHeaders
:
[
'
version
'
,
function
(
cb
,
results
)
{
async
.
auto
({
responseCondition
:
function
(
cb2
)
{
var
condition
=
{
name
:
'
routes/?tip_bar= (response)
'
,
statement
:
'
req.url ~ "
\\
?tip_bar="
'
,
type
:
'
RESPONSE
'
,
priority
:
10
};
fastly
.
setCondition
(
results
.
version
,
condition
,
cb2
);
},
responseObject
:
function
(
cb2
)
{
var
responseObject
=
{
name
:
'
redirects/?tip_bar=
'
,
status
:
301
,
response
:
'
Moved Permanently
'
,
request_condition
:
'
routes/?tip_bar= (response)
'
};
fastly
.
setResponseObject
(
results
.
version
,
responseObject
,
cb2
);
},
redirectHeader
:
[
'
responseCondition
'
,
function
(
cb2
,
redirectResults
)
{
var
header
=
{
name
:
'
redirects/?tip_bar=
'
,
action
:
'
set
'
,
ignore_if_set
:
0
,
type
:
'
RESPONSE
'
,
dst
:
'
http.Location
'
,
src
:
'
regsub(req.url, "tip_bar=", "tutorial=")
'
,
response_condition
:
redirectResults
.
responseCondition
.
name
};
fastly
.
setFastlyHeader
(
results
.
version
,
header
,
cb2
);
}]
},
function
(
err
,
redirectResults
)
{
if
(
err
)
return
cb
(
err
);
cb
(
null
,
redirectResults
);
});
}]
},
function
(
err
,
results
)
{
if
(
err
)
throw
new
Error
(
err
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment