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
66edcb60
Commit
66edcb60
authored
Nov 30, 2017
by
Colby Gutierrez-Kraybill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused vcl code generators, setBackend and setFrontend
parent
279e25eb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
43 deletions
+0
-43
bin/lib/fastly-config-methods.js
bin/lib/fastly-config-methods.js
+0
-43
No files found.
bin/lib/fastly-config-methods.js
View file @
66edcb60
...
@@ -84,49 +84,6 @@ var FastlyConfigMethods = {
...
@@ -84,49 +84,6 @@ var FastlyConfigMethods = {
return
'
redirects/
'
+
route
.
pattern
;
return
'
redirects/
'
+
route
.
pattern
;
},
},
/**
* Returns custom vcl configuration as a string for setting the backend
* of a request to the given backend/host.
*
* @param {string} backend name of the backend declared in fastly
* @param {string} host name of the s3 bucket to be set as the host
* @param {string} condition condition under which backend should be set
*/
setBackend
:
function
(
backend
,
host
,
condition
)
{
return
''
+
'
if (
'
+
condition
+
'
) {
\n
'
+
'
set req.backend =
'
+
backend
+
'
;
\n
'
+
'
set req.http.host =
\
"
'
+
host
+
'
\
";
\n
'
+
'
}
\n
'
;
},
/**
* Returns custom vcl configuration as a string for headers that
* should be added for the condition in which a request is forwarded.
*
* @param {string} condition condition under which to set pass headers
*/
setForwardHeaders
:
function
(
condition
)
{
return
''
+
'
if (
'
+
condition
+
'
) {
\n
'
+
'
if (!req.http.Fastly-FF) {
\n
'
+
'
if (req.http.X-Forwarded-For) {
\n
'
+
'
set req.http.Fastly-Temp-XFF = req.http.X-Forwarded-For
\
",
\
" client.ip;
\n
'
+
'
} else {
\n
'
+
'
set req.http.Fastly-Temp-XFF = client.ip;
\n
'
+
'
}
\n
'
+
'
} else {
\n
'
+
'
set req.http.Fastly-Temp-XFF = req.http.X-Forwarded-For;
\n
'
+
'
}
\n
'
+
'
set req.grace = 60s;
\n
'
+
'
if (req.url ~ "^/projects/" && !req.http.Cookie:scratchsessionid) {
\n
'
+
'
set req.http.Cookie = req.http.Cookie:scratchlanguage;
\n
'
+
'
} else {
\n
'
+
'
return(pass);
\n
'
+
'
}
\n
'
+
'
}
\n
'
;
},
/**
/**
* Returns custom vcl configuration as a string that sets the varnish
* Returns custom vcl configuration as a string that sets the varnish
* Time to Live (TTL) for responses that come from s3.
* Time to Live (TTL) for responses that come from s3.
...
...
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