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
b9b90ae6
Unverified
Commit
b9b90ae6
authored
Dec 05, 2018
by
chrisgarrity
Committed by
GitHub
Dec 05, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2403 from chrisgarrity/issue/2399-fix-fastly
Revised ?tip_bar= fastly rules
parents
8d88ab9b
84884beb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
bin/configure-fastly.js
bin/configure-fastly.js
+46
-0
No files found.
bin/configure-fastly.js
View file @
b9b90ae6
...
...
@@ -171,6 +171,52 @@ async.auto({
if
(
err
)
return
cb
(
err
);
cb
(
null
,
headers
);
});
}],
tipbarRedirectHeaders
:
[
'
version
'
,
function
(
cb
,
results
)
{
async
.
auto
({
requestCondition
:
function
(
cb2
)
{
var
condition
=
{
name
:
'
routes/?tip_bar= (request)
'
,
statement
:
'
req.url ~ "
\\
?tip_bar="
'
,
type
:
'
REQUEST
'
,
priority
:
10
};
fastly
.
setCondition
(
results
.
version
,
condition
,
cb2
);
},
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
:
[
'
requestCondition
'
,
function
(
cb2
,
redirectResults
)
{
var
responseObject
=
{
name
:
'
redirects/?tip_bar=
'
,
status
:
301
,
response
:
'
Moved Permanently
'
,
request_condition
:
redirectResults
.
requestCondition
.
name
};
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