-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathurlFlow.js
117 lines (110 loc) · 9.13 KB
/
urlFlow.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
const nock = require('nock');
nock.disableNetConnect();
nock('https://images.unsplash.com:443', {"encodedQueryParams":true})
.get('/')
.reply(200, "<!DOCTYPE html>\n\t<html>\n\t\t<head>\n\t\t\t<title>imgix - Image Processing On-Demand, Served By CDN</title>\n\t\t\t<style type=\"text/css\">\n\t\t\t\tbody {\n\t\t\t\t\tfont-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n\t\t\t\t\twidth: 400px;\n\t\t\t\t\tmargin: 80px auto;\n\t\t\t\t\ttext-align: center;\n\t\t\t\t}\n\t\t\t\tdl, dt, dd {\n\t\t\t\t\tmargin-left: 0;\n\t\t\t\t\tfont-size: 10px;\n\t\t\t\t}\n\t\t\t\tdt\n\t\t\t\t{\n\t\t\t\t\tfont-weight: bold;\n\t\t\t\t}\n\t\t\t</style>\n\t\t</head>\n\t\t<body>\n\t\t\t<svg version=\"1.1\" x=\"0px\" y=\"0px\" width=\"306px\" height=\"100px\" class=\"imgix-logo-svg\" viewbox=\"0 0 306 100\">\n\t\t\t\t<linearGradient id=\"ix_gradient\" gradientUnits=\"userSpaceOnUse\" x1=\"252\" y1=\"96\" x2=\"252\" y2=\"4\">\n\t\t\t\t\t<stop offset=\"0\" style=\"stop-color:#D84A2E\" />\n\t\t\t\t\t<stop offset=\"1\" style=\"stop-color:#FF6644\" />\n\t\t\t\t</linearGradient>\n\t\t\t\t<path fill=\"url(#ix_gradient)\" d=\"M306,89.5c0,3.6-2.9,6.5-6.4,6.5h-95.2c-3.5,0-6.4-2.9-6.4-6.5l0-79c0-3.6,2.9-6.5,6.4-6.5h95.2c3.5,0,6.4,2.9,6.4,6.5L306,89.5z\"/>\n\t\t\t\t<path fill=\"#F5F5F5\" d=\"M216.8,82.8c-3.6,0-6.4-2.9-6.4-6.5V24.4c0-3.6,2.9-6.5,6.4-6.5s6.4,2.9,6.4,6.5v51.9C223.3,79.9,220.4,82.8,216.8,82.8z\"/>\n\t\t\t\t<path fill=\"#F5F5F5\" d=\"M274,49.6L292.8,28c2.3-2.7,2.1-6.8-0.6-9.2c-2.7-2.4-6.7-2.1-9.1,0.6l-17.7,20.4l-17.7-20.4c-2.3-2.7-6.4-3-9.1-0.6c-2.7,2.4-2.9,6.5-0.6,9.2l18.8,21.7L238,71.3c-2.3,2.7-2.1,6.8,0.6,9.2c1.2,1.1,2.7,1.6,4.2,1.6c1.8,0,3.6-0.7,4.9-2.2l17.7-20.4l17.7,20.4c1.3,1.5,3.1,2.2,4.9,2.2c1.5,0,3-0.5,4.2-1.6c2.7-2.4,2.9-6.5,0.6-9.2L274,49.6z\"/>\n\t\t\t\t<path fill=\"#486071\" d=\"M8,66V34H0V24h18v42h8v10H0V66H8z M18,6c0,3.3-2.7,6-6,6S6,9.3,6,6s2.7-6,6-6S18,2.7,18,6z\" />\n\t\t\t\t<path fill=\"#486071\" d=\"M40,66V34h-8V24h18.8v6c6-4.9,12.3-7.1,18.1-7.1c5.8,0,9.8,2.7,12,8.1c6.6-5.4,12.8-8.1,18.5-8.1c3.3,0,6,0.7,8.1,2.2c2.1,1.5,3.6,3.4,4.3,5.6c0.7,2.3,1.1,5.6,1.1,10V66h9v10h-19.1V42.6c0-3-0.1-5.1-0.4-6.3c-0.3-1.2-0.9-2.2-2-3.1c-1.1-0.8-2.4-1.2-3.9-1.2c-4.3,0-9.1,2.2-14.6,6.7V66H90v10H72.1V41.7c0-3.4-0.5-5.8-1.4-7.4c-1-1.5-2.6-2.3-4.9-2.3c-3.8,0-9.8,1.5-15.7,6v28h10.1v10H32V66H40z\"/>\n\t\t\t\t<path fill=\"#486071\" d=\"M186,24v10h-8.6l-0.1,37.4c0,5.2-0.3,9.1-0.8,11.6c-0.5,2.5-1.8,5.1-3.8,7.7c-2,2.6-5,4.8-9.1,6.6c-4,1.8-8.6,2.7-13.5,2.7c-7.5,0-14.2-2.3-20.1-6.9l6.5-7.4c4.4,3.5,9.2,5.2,14.4,5.2c2.9,0,5.5-0.6,8-1.7c2.5-1.1,4.3-2.5,5.5-4.1c1.2-1.6,2-3.1,2.3-4.6c0.4-1.4,0.5-3.9,0.5-7.3v-4.7c-1.6,2-4.1,4-7.4,5.8c-3.4,1.8-7.1,2.7-11.1,2.7c-7.3,0-13.3-2.6-17.9-7.7c-4.6-5.1-6.9-11.5-6.9-19c0-8.2,2.5-14.8,7.6-19.9c5.1-5.1,10.9-7.6,17.6-7.6c6.7,0,13.5,3.6,18.8,9.1v-8H186z M134.6,50.2c0,5.2,1.5,9.5,4.5,12.9c3,3.3,6.8,5,11.5,5c4.6,0,8.5-1.7,11.8-5c3.3-3.3,5-7.6,5-12.9c0-5.3-1.7-9.6-5-12.8c-3.3-3.2-7.1-4.8-11.5-4.8c-4.4,0-8.2,1.6-11.4,4.8C136.3,40.4,134.6,44.8,134.6,50.2z\"/>\n\t\t\t</svg>\n\t\t\t<br>\n\t\t\t<p>\n\t\t\t\t<b>imgix Configuration Details</b>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<dl>\n\t\t\t\t\t<dt>Last Deployed</dt>\n\t\t\t\t\t<dd>Tue Feb 26, 2019 01:00:34 PM PST (1551214834)</dd>\n\t\t\t\t</dl>\n\t\t\t\t<dl>\n\t\t\t\t\t<dt>Hash</dt>\n\t\t\t\t\t<dd>JY5o9Ga0aZFo</dd>\n\t\t\t\t</dl>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<a href=\"https://dashboard.imgix.com/\">Dashboard</a> <a href=\"https://www.imgix.com/\">Website</a>\n\t\t\t</p>\n\t\t</body>\n\t</html>", [ 'Server',
'Varnish',
'Retry-After',
'0',
'Content-Length',
'3038',
'Date',
'Sun, 03 Mar 2019 00:00:01 GMT',
'Connection',
'close',
'Accept-Ranges',
'bytes',
'Set-Cookie',
'ugid=073fa2e44d83d96f2349302a657932215171728;domain=.unsplash.com;path=/;expires=Sun, 01 Mar 2020 09:23:01 GMT',
'Content-Type',
'text/html',
'Cache-Control',
'public, max-age=5',
'X-Content-Type-Options',
'nosniff',
'X-Served-By',
'cache-lhr6348-LHR',
'X-Cache',
'MISS' ]);
nock('https://images.unsplash.com:443', {"encodedQueryParams":true})
.get('/photo-1504455583697')
.reply(404, "", [ 'Server',
'imgix-fe',
'Cache-Control',
'public,max-age=300',
'X-Imgix-ID',
'16836dc700473d317ba9cc6c1a3e271940cb6a9a',
'Date',
'Sun, 03 Mar 2019 00:00:01 GMT',
'Connection',
'close',
'Age',
'0',
'Accept-Ranges',
'bytes',
'Set-Cookie',
'ugid=073fa2e44d83d96f2349302a657932215171728;domain=.unsplash.com;path=/;expires=Sun, 01 Mar 2020 09:23:01 GMT',
'Content-Type',
'text/plain',
'X-Content-Type-Options',
'nosniff',
'X-Served-By',
'cache-lax8649-LAX, cache-lhr6340-LHR',
'X-Cache',
'MISS, MISS',
'Transfer-Encoding',
'chunked' ]);
nock('https://images.unsplash.com:443', {"encodedQueryParams":true})
.get('/')
.reply(200, "<!DOCTYPE html>\n\t<html>\n\t\t<head>\n\t\t\t<title>imgix - Image Processing On-Demand, Served By CDN</title>\n\t\t\t<style type=\"text/css\">\n\t\t\t\tbody {\n\t\t\t\t\tfont-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n\t\t\t\t\twidth: 400px;\n\t\t\t\t\tmargin: 80px auto;\n\t\t\t\t\ttext-align: center;\n\t\t\t\t}\n\t\t\t\tdl, dt, dd {\n\t\t\t\t\tmargin-left: 0;\n\t\t\t\t\tfont-size: 10px;\n\t\t\t\t}\n\t\t\t\tdt\n\t\t\t\t{\n\t\t\t\t\tfont-weight: bold;\n\t\t\t\t}\n\t\t\t</style>\n\t\t</head>\n\t\t<body>\n\t\t\t<svg version=\"1.1\" x=\"0px\" y=\"0px\" width=\"306px\" height=\"100px\" class=\"imgix-logo-svg\" viewbox=\"0 0 306 100\">\n\t\t\t\t<linearGradient id=\"ix_gradient\" gradientUnits=\"userSpaceOnUse\" x1=\"252\" y1=\"96\" x2=\"252\" y2=\"4\">\n\t\t\t\t\t<stop offset=\"0\" style=\"stop-color:#D84A2E\" />\n\t\t\t\t\t<stop offset=\"1\" style=\"stop-color:#FF6644\" />\n\t\t\t\t</linearGradient>\n\t\t\t\t<path fill=\"url(#ix_gradient)\" d=\"M306,89.5c0,3.6-2.9,6.5-6.4,6.5h-95.2c-3.5,0-6.4-2.9-6.4-6.5l0-79c0-3.6,2.9-6.5,6.4-6.5h95.2c3.5,0,6.4,2.9,6.4,6.5L306,89.5z\"/>\n\t\t\t\t<path fill=\"#F5F5F5\" d=\"M216.8,82.8c-3.6,0-6.4-2.9-6.4-6.5V24.4c0-3.6,2.9-6.5,6.4-6.5s6.4,2.9,6.4,6.5v51.9C223.3,79.9,220.4,82.8,216.8,82.8z\"/>\n\t\t\t\t<path fill=\"#F5F5F5\" d=\"M274,49.6L292.8,28c2.3-2.7,2.1-6.8-0.6-9.2c-2.7-2.4-6.7-2.1-9.1,0.6l-17.7,20.4l-17.7-20.4c-2.3-2.7-6.4-3-9.1-0.6c-2.7,2.4-2.9,6.5-0.6,9.2l18.8,21.7L238,71.3c-2.3,2.7-2.1,6.8,0.6,9.2c1.2,1.1,2.7,1.6,4.2,1.6c1.8,0,3.6-0.7,4.9-2.2l17.7-20.4l17.7,20.4c1.3,1.5,3.1,2.2,4.9,2.2c1.5,0,3-0.5,4.2-1.6c2.7-2.4,2.9-6.5,0.6-9.2L274,49.6z\"/>\n\t\t\t\t<path fill=\"#486071\" d=\"M8,66V34H0V24h18v42h8v10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4.8c-4.4,0-8.2,1.6-11.4,4.8C136.3,40.4,134.6,44.8,134.6,50.2z\"/>\n\t\t\t</svg>\n\t\t\t<br>\n\t\t\t<p>\n\t\t\t\t<b>imgix Configuration Details</b>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<dl>\n\t\t\t\t\t<dt>Last Deployed</dt>\n\t\t\t\t\t<dd>Tue Feb 26, 2019 01:00:34 PM PST (1551214834)</dd>\n\t\t\t\t</dl>\n\t\t\t\t<dl>\n\t\t\t\t\t<dt>Hash</dt>\n\t\t\t\t\t<dd>JY5o9Ga0aZFo</dd>\n\t\t\t\t</dl>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<a href=\"https://dashboard.imgix.com/\">Dashboard</a> <a href=\"https://www.imgix.com/\">Website</a>\n\t\t\t</p>\n\t\t</body>\n\t</html>", [ 'Server',
'Varnish',
'Retry-After',
'0',
'Content-Length',
'3038',
'Date',
'Sun, 03 Mar 2019 00:00:01 GMT',
'Connection',
'close',
'Accept-Ranges',
'bytes',
'Set-Cookie',
'ugid=073fa2e44d83d96f2349302a657932215171728;domain=.unsplash.com;path=/;expires=Sun, 01 Mar 2020 09:23:01 GMT',
'Content-Type',
'text/html',
'Cache-Control',
'public, max-age=5',
'X-Content-Type-Options',
'nosniff',
'X-Served-By',
'cache-lhr6347-LHR',
'X-Cache',
'MISS' ]);
nock('https://images.unsplash.com:443', {"encodedQueryParams":true})
.get('/photo-1504455583697')
.reply(404, "", [ 'Server',
'imgix-fe',
'Cache-Control',
'public,max-age=300',
'X-Imgix-ID',
'16836dc700473d317ba9cc6c1a3e271940cb6a9a',
'Content-Length',
'0',
'Date',
'Sun, 03 Mar 2019 00:00:01 GMT',
'Connection',
'close',
'Age',
'0',
'Accept-Ranges',
'bytes',
'Set-Cookie',
'ugid=073fa2e44d83d96f2349302a657932215171728;domain=.unsplash.com;path=/;expires=Sun, 01 Mar 2020 09:23:01 GMT',
'Content-Type',
'text/plain',
'X-Content-Type-Options',
'nosniff',
'X-Served-By',
'cache-lax8649-LAX, cache-lhr6336-LHR',
'X-Cache',
'MISS, HIT' ]);