From 94188a0b2c251e1bd4f4d4e48f778d3957d7830e Mon Sep 17 00:00:00 2001 From: Richard van der Dys Date: Sun, 13 Oct 2019 16:03:54 +0300 Subject: [PATCH] Fixed main image case sensitivity bug Fixes #128 --- package.json | 2 +- .../recording.har | 1267 +++++++++++++++++ src/page.js | 2 +- test/real.js | 11 + 4 files changed, 1280 insertions(+), 2 deletions(-) create mode 100644 recordings/Live-tests_4163164458/should-fetch-main-image-128_567656416/recording.har diff --git a/package.json b/package.json index 42bdd28..cff822e 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "wikijs", "description": "Mediawiki interface for Node and Web", "author": "Richard van der Dys", - "version": "6.0.0", + "version": "6.0.1", "keywords": [ "wiki", "wikipedia", diff --git a/recordings/Live-tests_4163164458/should-fetch-main-image-128_567656416/recording.har b/recordings/Live-tests_4163164458/should-fetch-main-image-128_567656416/recording.har new file mode 100644 index 0000000..544894c --- /dev/null +++ b/recordings/Live-tests_4163164458/should-fetch-main-image-128_567656416/recording.har @@ -0,0 +1,1267 @@ +{ + "log": { + "_recordingName": "Live tests/should fetch main image #128", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "2.5.0" + }, + "entries": [ + { + "_id": "9bc890d7b6d9a6ebe4052a4c98700a24", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "en.wikipedia.org" + } + ], + "headersSize": 324, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "format", + "value": "json" + }, + { + "name": "action", + "value": "query" + }, + { + "name": "redirects", + "value": "" + }, + { + "name": "prop", + "value": "info|pageprops" + }, + { + "name": "inprop", + "value": "url" + }, + { + "name": "ppprop", + "value": "disambiguation" + }, + { + "name": "titles", + "value": "Microsoft" + }, + { + "name": "origin", + "value": "*" + } + ], + "url": "http://en.wikipedia.org/w/api.php?format=json&action=query&redirects=&prop=info%7Cpageprops&inprop=url&ppprop=disambiguation&titles=Microsoft&origin=%2A" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [ + { + "expires": "2019-11-14T12:00:00.000Z", + "httpOnly": true, + "name": "WMF-Last-Access", + "path": "/", + "secure": true, + "value": "13-Oct-2019" + }, + { + "domain": ".wikipedia.org", + "expires": "2019-11-14T12:00:00.000Z", + "httpOnly": true, + "name": "WMF-Last-Access-Global", + "path": "/", + "secure": true, + "value": "13-Oct-2019" + } + ], + "headers": [ + { + "name": "date", + "value": "Sun, 13 Oct 2019 12:55:40 GMT" + }, + { + "name": "server", + "value": "Varnish" + }, + { + "name": "x-varnish", + "value": "503942099" + }, + { + "name": "x-cache", + "value": "cp3032 int" + }, + { + "name": "x-cache-status", + "value": "int-front" + }, + { + "name": "server-timing", + "value": "cache;desc=\"int-front\"" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "WMF-Last-Access=13-Oct-2019;Path=/;HttpOnly;secure;Expires=Thu, 14 Nov 2019 12:00:00 GMT" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "WMF-Last-Access-Global=13-Oct-2019;Path=/;Domain=.wikipedia.org;HttpOnly;secure;Expires=Thu, 14 Nov 2019 12:00:00 GMT" + }, + { + "name": "x-client-ip", + "value": "82.78.189.22" + }, + { + "name": "location", + "value": "https://en.wikipedia.org/w/api.php?format=json&action=query&redirects=&prop=info%7Cpageprops&inprop=url&ppprop=disambiguation&titles=Microsoft&origin=%2A" + }, + { + "name": "content-length", + "value": "0" + }, + { + "name": "connection", + "value": "close" + } + ], + "headersSize": 628, + "httpVersion": "HTTP/1.1", + "redirectURL": "https://en.wikipedia.org/w/api.php?format=json&action=query&redirects=&prop=info%7Cpageprops&inprop=url&ppprop=disambiguation&titles=Microsoft&origin=%2A", + "status": 301, + "statusText": "Moved Permanently" + }, + "startedDateTime": "2019-10-13T12:55:40.228Z", + "time": 152, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 152 + } + }, + { + "_id": "9ee4bf2f6b5778e2b193ba17e3e8060e", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "en.wikipedia.org" + } + ], + "headersSize": 325, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "format", + "value": "json" + }, + { + "name": "action", + "value": "query" + }, + { + "name": "redirects", + "value": "" + }, + { + "name": "prop", + "value": "info|pageprops" + }, + { + "name": "inprop", + "value": "url" + }, + { + "name": "ppprop", + "value": "disambiguation" + }, + { + "name": "titles", + "value": "Microsoft" + }, + { + "name": "origin", + "value": "*" + } + ], + "url": "https://en.wikipedia.org/w/api.php?format=json&action=query&redirects=&prop=info%7Cpageprops&inprop=url&ppprop=disambiguation&titles=Microsoft&origin=%2A" + }, + "response": { + "bodySize": 261, + "content": { + "mimeType": "application/json; charset=utf-8", + "size": 261, + "text": "[\"1f8b08000000000000039550c14ec42014fc9777f0d46da1ea7621d9f805de3c7943fab690a580f455d76cfc771f9b688c31317201669861e69de1c9907536cd3920216880069e572c6fa0cf90cd844b3d482584fc44fc08fa02341099150d90a750b5f7de96b4a403b1894d9130d29c460c4cbdfaa3273c55a67a0413a795776630fec01ccdc1b2ec376ef485e14085714aab75c861a017526da4d848f92095ee9596bb477e10cc42055f6a5ed58b61b81e765b46314ee4b8c2addade7087c31ac25a6a46479417dd7518db1a37f36fa64d65eaeaadfb5e8e19fa4bd3f938e2a9cd2edf5de6b3ff32b832967c8afbea522765628ade9a7fa678e7f5010ef5cf70bf010000\"]" + }, + "cookies": [ + { + "expires": "2019-11-14T12:00:00.000Z", + "httpOnly": true, + "name": "WMF-Last-Access", + "path": "/", + "secure": true, + "value": "13-Oct-2019" + }, + { + "domain": ".wikipedia.org", + "expires": "2019-11-14T12:00:00.000Z", + "httpOnly": true, + "name": "WMF-Last-Access-Global", + "path": "/", + "secure": true, + "value": "13-Oct-2019" + }, + { + "domain": ".wikipedia.org", + "name": "GeoIP", + "path": "/", + "secure": true, + "value": "RO:BV:Brasov:45.65:25.61:v4" + } + ], + "headers": [ + { + "name": "date", + "value": "Sun, 13 Oct 2019 12:55:40 GMT" + }, + { + "name": "content-type", + "value": "application/json; charset=utf-8" + }, + { + "name": "content-length", + "value": "261" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "server", + "value": "mw1288.eqiad.wmnet" + }, + { + "name": "x-powered-by", + "value": "PHP/7.2.22-1+0~20190902.26+debian9~1.gbpd64eb7+wmf1" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "p3p", + "value": "CP=\"See https://en.wikipedia.org/wiki/Special:CentralAutoLogin/P3P for more info.\"" + }, + { + "name": "mediawiki-login-suppressed", + "value": "true" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-allow-credentials", + "value": "false" + }, + { + "name": "access-control-expose-headers", + "value": "MediaWiki-API-Error, Retry-After, X-Database-Lag, MediaWiki-Login-Suppressed" + }, + { + "name": "x-frame-options", + "value": "SAMEORIGIN" + }, + { + "name": "content-disposition", + "value": "inline; filename=api-result.json" + }, + { + "name": "vary", + "value": "Accept-Encoding,Treat-as-Untrusted,X-Forwarded-Proto,Cookie,Authorization" + }, + { + "name": "cache-control", + "value": "private, must-revalidate, max-age=0" + }, + { + "name": "backend-timing", + "value": "D=25824 t=1570971340622778" + }, + { + "name": "content-encoding", + "value": "gzip" + }, + { + "name": "x-varnish", + "value": "39627321, 615489422, 487232310" + }, + { + "name": "accept-ranges", + "value": "bytes" + }, + { + "name": "age", + "value": "0" + }, + { + "name": "x-cache", + "value": "cp1077 pass, cp3032 pass, cp3032 pass" + }, + { + "name": "x-cache-status", + "value": "pass" + }, + { + "name": "server-timing", + "value": "cache;desc=\"pass\"" + }, + { + "name": "strict-transport-security", + "value": "max-age=106384710; includeSubDomains; preload" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "WMF-Last-Access=13-Oct-2019;Path=/;HttpOnly;secure;Expires=Thu, 14 Nov 2019 12:00:00 GMT" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "WMF-Last-Access-Global=13-Oct-2019;Path=/;Domain=.wikipedia.org;HttpOnly;secure;Expires=Thu, 14 Nov 2019 12:00:00 GMT" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "GeoIP=RO:BV:Brasov:45.65:25.61:v4; Path=/; secure; Domain=.wikipedia.org" + }, + { + "name": "x-analytics", + "value": "ns=-1;special=Badtitle;https=1;nocookies=1" + }, + { + "name": "x-client-ip", + "value": "82.78.189.22" + } + ], + "headersSize": 1498, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2019-10-13T12:55:40.387Z", + "time": 323, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 323 + } + }, + { + "_id": "43f60ef63ccaed16a1f8bd095524489c", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "en.wikipedia.org" + } + ], + "headersSize": 325, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "format", + "value": "json" + }, + { + "name": "action", + "value": "query" + }, + { + "name": "redirects", + "value": "" + }, + { + "name": "generator", + "value": "images" + }, + { + "name": "gimlimit", + "value": "max" + }, + { + "name": "prop", + "value": "imageinfo" + }, + { + "name": "iiprop", + "value": "url" + }, + { + "name": "titles", + "value": "Microsoft" + }, + { + "name": "origin", + "value": "*" + } + ], + "url": "http://en.wikipedia.org/w/api.php?format=json&action=query&redirects=&generator=images&gimlimit=max&prop=imageinfo&iiprop=url&titles=Microsoft&origin=%2A" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [ + { + "expires": "2019-11-14T12:00:00.000Z", + "httpOnly": true, + "name": "WMF-Last-Access", + "path": "/", + "secure": true, + "value": "13-Oct-2019" + }, + { + "domain": ".wikipedia.org", + "expires": "2019-11-14T12:00:00.000Z", + "httpOnly": true, + "name": "WMF-Last-Access-Global", + "path": "/", + "secure": true, + "value": "13-Oct-2019" + } + ], + "headers": [ + { + "name": "date", + "value": "Sun, 13 Oct 2019 12:55:40 GMT" + }, + { + "name": "server", + "value": "Varnish" + }, + { + "name": "x-varnish", + "value": "488245867" + }, + { + "name": "x-cache", + "value": "cp3032 int" + }, + { + "name": "x-cache-status", + "value": "int-front" + }, + { + "name": "server-timing", + "value": "cache;desc=\"int-front\"" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "WMF-Last-Access=13-Oct-2019;Path=/;HttpOnly;secure;Expires=Thu, 14 Nov 2019 12:00:00 GMT" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "WMF-Last-Access-Global=13-Oct-2019;Path=/;Domain=.wikipedia.org;HttpOnly;secure;Expires=Thu, 14 Nov 2019 12:00:00 GMT" + }, + { + "name": "x-client-ip", + "value": "82.78.189.22" + }, + { + "name": "location", + "value": "https://en.wikipedia.org/w/api.php?format=json&action=query&redirects=&generator=images&gimlimit=max&prop=imageinfo&iiprop=url&titles=Microsoft&origin=%2A" + }, + { + "name": "content-length", + "value": "0" + }, + { + "name": "connection", + "value": "close" + } + ], + "headersSize": 629, + "httpVersion": "HTTP/1.1", + "redirectURL": "https://en.wikipedia.org/w/api.php?format=json&action=query&redirects=&generator=images&gimlimit=max&prop=imageinfo&iiprop=url&titles=Microsoft&origin=%2A", + "status": 301, + "statusText": "Moved Permanently" + }, + "startedDateTime": "2019-10-13T12:55:40.719Z", + "time": 95, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 95 + } + }, + { + "_id": "a2f6a1c2c22cc875f1a0e5d65729b95d", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "en.wikipedia.org" + } + ], + "headersSize": 311, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "format", + "value": "json" + }, + { + "name": "action", + "value": "query" + }, + { + "name": "redirects", + "value": "" + }, + { + "name": "prop", + "value": "revisions" + }, + { + "name": "rvprop", + "value": "content" + }, + { + "name": "rvsection", + "value": "0" + }, + { + "name": "titles", + "value": "Microsoft" + }, + { + "name": "origin", + "value": "*" + } + ], + "url": "http://en.wikipedia.org/w/api.php?format=json&action=query&redirects=&prop=revisions&rvprop=content&rvsection=0&titles=Microsoft&origin=%2A" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [ + { + "expires": "2019-11-14T12:00:00.000Z", + "httpOnly": true, + "name": "WMF-Last-Access", + "path": "/", + "secure": true, + "value": "13-Oct-2019" + }, + { + "domain": ".wikipedia.org", + "expires": "2019-11-14T12:00:00.000Z", + "httpOnly": true, + "name": "WMF-Last-Access-Global", + "path": "/", + "secure": true, + "value": "13-Oct-2019" + } + ], + "headers": [ + { + "name": "date", + "value": "Sun, 13 Oct 2019 12:55:40 GMT" + }, + { + "name": "server", + "value": "Varnish" + }, + { + "name": "x-varnish", + "value": "482232091" + }, + { + "name": "x-cache", + "value": "cp3032 int" + }, + { + "name": "x-cache-status", + "value": "int-front" + }, + { + "name": "server-timing", + "value": "cache;desc=\"int-front\"" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "WMF-Last-Access=13-Oct-2019;Path=/;HttpOnly;secure;Expires=Thu, 14 Nov 2019 12:00:00 GMT" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "WMF-Last-Access-Global=13-Oct-2019;Path=/;Domain=.wikipedia.org;HttpOnly;secure;Expires=Thu, 14 Nov 2019 12:00:00 GMT" + }, + { + "name": "x-client-ip", + "value": "82.78.189.22" + }, + { + "name": "location", + "value": "https://en.wikipedia.org/w/api.php?format=json&action=query&redirects=&prop=revisions&rvprop=content&rvsection=0&titles=Microsoft&origin=%2A" + }, + { + "name": "content-length", + "value": "0" + }, + { + "name": "connection", + "value": "close" + } + ], + "headersSize": 615, + "httpVersion": "HTTP/1.1", + "redirectURL": "https://en.wikipedia.org/w/api.php?format=json&action=query&redirects=&prop=revisions&rvprop=content&rvsection=0&titles=Microsoft&origin=%2A", + "status": 301, + "statusText": "Moved Permanently" + }, + "startedDateTime": "2019-10-13T12:55:40.719Z", + "time": 101, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 101 + } + }, + { + "_id": "ba2368d317804732a706849a86682075", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "en.wikipedia.org" + } + ], + "headersSize": 326, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "format", + "value": "json" + }, + { + "name": "action", + "value": "query" + }, + { + "name": "redirects", + "value": "" + }, + { + "name": "generator", + "value": "images" + }, + { + "name": "gimlimit", + "value": "max" + }, + { + "name": "prop", + "value": "imageinfo" + }, + { + "name": "iiprop", + "value": "url" + }, + { + "name": "titles", + "value": "Microsoft" + }, + { + "name": "origin", + "value": "*" + } + ], + "url": "https://en.wikipedia.org/w/api.php?format=json&action=query&redirects=&generator=images&gimlimit=max&prop=imageinfo&iiprop=url&titles=Microsoft&origin=%2A" + }, + "response": { + "bodySize": 3549, + "content": { + "mimeType": "application/json; charset=utf-8", + "size": 3549, + "text": "[\"1f8b0800000000000003ed9a6b6fdb361486ff0a61a0430358e64dd700c39014db9a2d590ba4453b0c03c148b4c35a165d49cea541fffb28cb52e45a721cc99ebea41f029b415fbe7ccee1ed300f832b9efad7be9acd43918ac1f160301c847226d36470fc3090333e11fa9385d0f7e1e0eb42c4f759f33c6f7d181838fb19e9cff67090ca34cc147e93a138a6088577a32ff389d69bc92491d124179f46ea36ca3f2ed5633157894c55a63c48ae792c82e257321aabc1f13f0f83451cea5f5ea7e93c398670310f150f46b7722a6722907ca4e209ccbecdb36f508f65a6a2040a283c58b51188c48fe53c952a5a175cfd8f1a45b831968a4872ade274272528a340dc8de6d7f35ffc452c839fb1e99916b6bcc1f77f35578334513c11b1e421b8907eac12354ec12791a4e00d9fcd170938594c16fa1b41c8eb157400031be64e59e994654e59ee94e54e59c569eb58b4efa743b81cd3b3b14757d1a28dd19aab30540063c0933456115fa4e074f1ed1b3809835846208da54880d2ad8f017dab42752ea204bc269ea393c2a40eb68e7a8da70f7d0be6636118b3722c2c1b0bcbc7c29663617a2c9550146361af885b19cd2bd23dea5ddcd491dd4f5ee8296c3ad8b35689613625c669b810602e225f86a3e4a6bfc83ad0a13033c3d6ccb40ecb56a90e5c0972908591bbe26a35725dc830d0183d322bc2deebcca17abf81cda6da73de45b2036f9b126adb76b1c0d94dbccf223f163c11a4d72cbe825708fe68a535db2d421d88ba9e8d1ca700ea34030df48615df5bbd02259070f8a3950e401b853a00356dd734292d88ba4d442fc095baeb95a6073d135eb0471bad493688745a585d6a13b3d8b0bc468ae5f9c432fe163c0697a9f2a7e0ad4c3260bde2451069bce52e9ffb634b7f6cdd5f7beecf54ef12108722d346e62a20183d1d91733551ab48489ff77ba030a1e95482116a6bd9e10f7b2ec94e7d7b8bc352f875267bb46ffc36793c6860fc34fe4f5a43dd26008f1058de8309a0bd1e3ac6705c9d102b7f4cfb63b93f46bb9e3f9eabdee5664c30b6f5f9af8808793a22597280b5e478990cfb980cf419e89da3be8f84763d7ae730e89d83a0b70bf4e6aee809c23d67bd3eeed4a1cf8c1d007d75bc7bbb6b7a9ee3e202bdb5237a1e05e056c5c18cc7d39700ec31008db7cfbfd45472f053a57876be98e99640dc485f24a379d4eba9740c9706357bbb52855a5a64eb165b07a345071d02435dcb3411292e0bb8f1167bc9d37b0e92990c3578631ecba8df320c86d8834b53acce546bfc3b497629c3b82642ae59ce84c64bee652a6e0438e56138133130c0c5d9e7ec19c0ed9b3a824b676ce58c194c3b631567edd1efacdba5ccef11447189bff1767cb988c7dc17ef6345477fbcffbd4fe21c6e9a690f799b549785c4743d4a9df2b5abf192fb41c52a4a55b9b8e97b772cdc5e19ebdb9503b7fa6a8d7b57d54ee74ac7a4a4ac9a91c6fbed272d1489dbc4c876f9\",\"be8b9126acb3d39af313625d2eab8850af7cfe21641bddaf0b958afef1ea7ce6b0d64f27bedbd4bae4af4788eb14d53142b701be11b12676bf34615c462a9ef65ba8d4abf315dc3026a27de07e52b24b5253e4101315cccd9d99973e5e7877e06d35f3ce0b8f2e38e78bc8bf06bfde8828053202275379cdaf78cc87e0839adeabbeff1a84c2a24ce8b2dc2b5b7a653262a5d757e40dabbaed109f27fb1a36f5d4656922ae655ba8dc5a1bafad9fafd41d781709f046cbaa50804bd1eff548df55adc7828191f933b43f63e5cfd0fe8cdb3ff596e9a77b2b1c3fb3972e874d4c2c07d3d5299eb8c8c5d441c55fadc960705cb40d6bc3853d179fca307ccf17e1cad8663842e5f3b05b344494158cc7b0a6bf46dc7ae529057e20bd5da686e7a6d6668a17f0962829d5196f394e1565d1568ff24d1eb2eab1e0802839ace9af0dcaed32ed5096f01e519ac4dd40a9dbea51fe16f2095063905e0bf03192a908c065ca53911c982b87dc8459e74c8d99ee9ce59db3b5cedb407e866607e219e37c1da0a643adfc7daf5c07566d0dc455188818bc15777ca2221e82335f4587cf6217e61db3b26356e9b815e9ddf45a2e1105d72565cb75f585c82455ca45db707b517d970de2655bdcd7b66861bd18b9ebd3a1681beef8e6e75847079e0e36b451edab9e63edf0b2b1654a6c3ee83d0ea6f39428d9564813679334717625eda2a35561ff800b4f50ff7e8a32d24f3c5b3c8bf4e360f6449aac36551beb04f7d673ba68ab27fdeedd97047c3c03522f8840f7931a611a1bf3584d62a10fe637e2c0f9ed4297c3cc04fb78c632136c8b8936f45b68b78b44c93ecf790f650f19ebabcbaaad3e12976226335fa95ef6b40943afebfe343c34ff65c5607bd76da8efacd832eb0bba396b87981ef6ec35d6abb661e37dd4f0f3ede67fd958f5e242614dafadb7cfed5a5d4a3198528a9c654157fffb0ffae8465d1d350000\"]" + }, + "cookies": [ + { + "expires": "2019-11-14T12:00:00.000Z", + "httpOnly": true, + "name": "WMF-Last-Access", + "path": "/", + "secure": true, + "value": "13-Oct-2019" + }, + { + "domain": ".wikipedia.org", + "expires": "2019-11-14T12:00:00.000Z", + "httpOnly": true, + "name": "WMF-Last-Access-Global", + "path": "/", + "secure": true, + "value": "13-Oct-2019" + }, + { + "domain": ".wikipedia.org", + "name": "GeoIP", + "path": "/", + "secure": true, + "value": "RO:BV:Brasov:45.65:25.61:v4" + } + ], + "headers": [ + { + "name": "date", + "value": "Sun, 13 Oct 2019 12:55:41 GMT" + }, + { + "name": "content-type", + "value": "application/json; charset=utf-8" + }, + { + "name": "transfer-encoding", + "value": "chunked" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "server", + "value": "mw1347.eqiad.wmnet" + }, + { + "name": "x-powered-by", + "value": "PHP/7.2.22-1+0~20190902.26+debian9~1.gbpd64eb7+wmf1" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "p3p", + "value": "CP=\"See https://en.wikipedia.org/wiki/Special:CentralAutoLogin/P3P for more info.\"" + }, + { + "name": "mediawiki-login-suppressed", + "value": "true" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-allow-credentials", + "value": "false" + }, + { + "name": "access-control-expose-headers", + "value": "MediaWiki-API-Error, Retry-After, X-Database-Lag, MediaWiki-Login-Suppressed" + }, + { + "name": "x-frame-options", + "value": "SAMEORIGIN" + }, + { + "name": "content-disposition", + "value": "inline; filename=api-result.json" + }, + { + "name": "vary", + "value": "Accept-Encoding,Treat-as-Untrusted,X-Forwarded-Proto,Cookie,Authorization" + }, + { + "name": "cache-control", + "value": "private, must-revalidate, max-age=0" + }, + { + "name": "backend-timing", + "value": "D=153173 t=1570971341007273" + }, + { + "name": "content-encoding", + "value": "gzip" + }, + { + "name": "x-varnish", + "value": "44179554, 142153873, 490212070" + }, + { + "name": "accept-ranges", + "value": "bytes" + }, + { + "name": "age", + "value": "0" + }, + { + "name": "x-cache", + "value": "cp1077 pass, cp3030 pass, cp3032 pass" + }, + { + "name": "x-cache-status", + "value": "pass" + }, + { + "name": "server-timing", + "value": "cache;desc=\"pass\"" + }, + { + "name": "strict-transport-security", + "value": "max-age=106384710; includeSubDomains; preload" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "WMF-Last-Access=13-Oct-2019;Path=/;HttpOnly;secure;Expires=Thu, 14 Nov 2019 12:00:00 GMT" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "WMF-Last-Access-Global=13-Oct-2019;Path=/;Domain=.wikipedia.org;HttpOnly;secure;Expires=Thu, 14 Nov 2019 12:00:00 GMT" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "GeoIP=RO:BV:Brasov:45.65:25.61:v4; Path=/; secure; Domain=.wikipedia.org" + }, + { + "name": "x-analytics", + "value": "ns=-1;special=Badtitle;https=1;nocookies=1" + }, + { + "name": "x-client-ip", + "value": "82.78.189.22" + } + ], + "headersSize": 1506, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2019-10-13T12:55:40.818Z", + "time": 420, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 420 + } + }, + { + "_id": "e553d7a510304390394f3e0749e41f1e", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "en.wikipedia.org" + } + ], + "headersSize": 312, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "format", + "value": "json" + }, + { + "name": "action", + "value": "query" + }, + { + "name": "redirects", + "value": "" + }, + { + "name": "prop", + "value": "revisions" + }, + { + "name": "rvprop", + "value": "content" + }, + { + "name": "rvsection", + "value": "0" + }, + { + "name": "titles", + "value": "Microsoft" + }, + { + "name": "origin", + "value": "*" + } + ], + "url": "https://en.wikipedia.org/w/api.php?format=json&action=query&redirects=&prop=revisions&rvprop=content&rvsection=0&titles=Microsoft&origin=%2A" + }, + "response": { + "bodySize": 10467, + "content": { + "mimeType": "application/json; charset=utf-8", + "size": 10467, + "text": "[\"1f8b0800000000000003\",\"c55b0977db4692fe2bbd4c3296e61124c14ba477947dbaec28896525b4e3cd527a7a4da0492204011a0d886604fdf7f9aa0f80870e6b36f3662692c83eabebfcaaba7d5719f1d49b7af17c118a54545e572ad5ca922751104d64e5f55d65ce8388fefe1d5d836c24bd24180996c62c9d0a36177ec097c12c70f8023f5114679187661e8498cfc240a68ca7ec1fd3345dc8d7f53a35c81a4d50336b7132a9d3e0398f545f108de3fac38b7ecfc671c2a2380db0413c664797e7cc178b44783c0de248321ef96c94083ea39dbd298f2642d6d84729d8703858082fe0e1eba345f046f0344bc447c927e2fa9a0e228560197da565ed92c267633d52b2d18aade22c617cb10803bd5dad725fad24e23690b4b7e5cf316666d8f0aa92dcca304ee555852db924aa992412c681f0ab8cb3504cb8b7a213cdc19e29868c848840056d8b63126fe32c5d64698d7d9806d28ec4a792c0aa3a7210a9d1e38c68551f23b1b4e3974118321e2ef98a7650eb837290fe3913c98ac85ee0dc8a7eb7df68b8b625f02baf5543b542a76b542b699086a41def022f89653c4e2b1be71fde55bc384a4594ea9d3132155fd2fa17870489b1a6771efb224427b5d200f410e3eeee168b5cce79181eae84bcbfbf8aa8c599c7b7c209225f8c75939cc6490a0e90122e480cf9c7daa0e64c05f73f673c494502fea5c29b4671184f568cb49a472b3d9934e1682e1248306267d104fa36cd7d30f2f01d5fb166c3ed97e3e6fe8a5197d4038eb249064d2ec79c434f47f117bbc15594b388cf053b64057fd8499c2ce244690bf583a078a35f3590049771e2cf7932abc9db891d79c3c314a38f98a48309e607b7812f48da50d83129a3cc468eee9455d011c674f684b462924097aa6c25c2305e6ab30833c1f6bc30f666cb408afd2a14239d2a653127d0e443c1054fc87eb04b904a960493695a23a2823919c8211b6541e86344bf39b727a9fdb19814436e3cae2483a1c76628eb3759acb574382ccfffabf0e73188f3f87c9149982234793834ad55f689cb2926a771747d4daba7ab05ed3f1c5e662358a1253cd75fcd988483493730a743064146a32c24a7e62b474403eeee2e8e06a747bfe4ef066f3e9028732ca89b1cb7d10011b46c1c415375df2938f823be4b761ef9d081045e841ddd8a0447cd4f7f3c3fda9d32f8db257b702deae86c776822ce07e717a0f9e3a0d36ff7dd9edb68771447f59eabc78e8335c1c9a55210712bc27831c7a29a17c3e10976c96013f02f894f83ca8e4866b0042642e1a5491c059eb47d83981c257c480ab554ae548ae4163eb7981cc699af4e90c15d4f6cf36f50cf984d488b2cd579d9562c7f0e2f9060f192146d2482dd8272f260d09f20e5210dd0bc81b647a4fac48341cac901d078d26b1282db3fe8e48d36febbbfd72a74148e32f26ff8a9b20b38c377e24be0c5d7d75546eea25c33918f33f6983ce75b720196d44b9e41f4181895b44d3fdfc0a8b851f8c7b53b7f1f8935d3ffc4577ad5b5f9375e90aed4220f98406edae80cc361d9cef6640a1af7f36d6bd9581887d54a648f0f5de0372457c5d64f7112fa4bc88aba666275b31031c0c0134ac7d3156717b0b530e47abf3d88721a88313bfb223c28c6ad60efc763a84d929f9cbdbfbede37e29e260861277c114b2976e6be831314a454e5dc7798ab447df6dba559e368be623fc4b1bf35f94d10f148e96e31f9cdeee49f32e8cfa9088f4524b616380d26a478e5f4d307a623e2456ce0c5690a7f6aed4b7a019417ecd9cfd7066c2dffa10c4bc50e1f767738860b638339b9e7bd\",\"225a857cb912c97e5e76168b5fc2ff437491a2c7da920ad6fb79d157f0ff47c123e7720a74064f8f08056ec4817ce9625b24ff184f23f689800a1822ad06aa83f30060202ab6df362a8c516cc12101537ca08938c9cb9623dda2a66b7b5b24b19f79a9b6db37214f4929f3abe8ef1bb6f7091e285ecadcfca5bd36076801e4facf6ef7802c2391b9f96b070c660841bba37f0b6406620769e60771bef16d77f0e90a8116ee36b71fec90ff059c7880922c1973506afeee0e78178f8250e4fa8fedfe996037b06c394c9a3091db2edb50ba32e3e69f61edd19ff0d1b9fa6d773b2683dd93000ede9489681244d09663131a3439d14cf8e791fdfe3b9f43b11fe08d0e6130a80b1d7d10a54f2fec382d2cd6ea768a96489c26f034c5f72c0de37856835ddaa6b741fa4336dadd8a740c9be4e6efee804b0e64a1bdf4964452002db6e76b67b19f6ff5d80946f5d8c70505ab752143ff11232fb9dc103dfbd91c440b03c85a449976c1e79107772d05c21bfcf1e0dbdc6d766abdbf4523b9f86f483d24188c6c6ba691f33f12f81a027387579537bfbb7de797f655e5fbbbbb13c06db614239667497868f3b1e572592b711c1857179193c9fa79742b24ce53172613acbff9dd21f88be5eac83fa47412800750e5604d8f43a972e5270ecfcc040440d5cf8808f64b9b6924fd6316ae98dbab2a2ccd724c960121f0828b39f73c5a7e6d74df8e260d039b9c8d138851cdb4ab6c12dfeb34ba71e0f69a6ec3edb4eaff8ec35a521e3a14c873282c67f230c418c8a40ea17cbf26d79b15b68270693c3593d2730a7c374104ba1e917bbb556b6c88fd1169b3faf71a3cd252db5b017b3db949ab5f6bbe609372b9ed8da0e0c238ea9d4d9abd6eadd379c1367ab1ed2dc4e74c63a6878ca4d1acb55a2fd8422fb6c3ae6c7e23e68b305e09b17318b7ddaeba8d2eadfaa8852119975b5a074f9e4a878f90e03b454ffd9b33b50d0178ca2ead3dbda1c14c0d5ef3e75f6738bd7fd170fa483f5cb75b7fe919768ef08095f4bfc24a3698be2d11e4bdc02168a02f860d1aaafefa73feb8a9e71b5fc9cbd2cf55f4ead5ab075376b453b505e0ab4061c3e13c0b61a5aa1f31de2b47e71b3d4048c3e16e1902cd2aed5e2b57c82792de1a3b4f6d5a87141f382a23ae672ae147ca2b22499f64b60015a9d4d520a0ea50aee5857909528b884f2984f7600a483d7045d21c4fcfbcbe366bc309aaba98450a44209595e00f6751bc8c8a2d4a98c64d49ea0174066e206aa99adb705838402657321573b5e7f6440bd72817d31b04b764ff76db6f0c4490306491abdf7424225d2f65934f24290baa972406caae6f72e623a7a45f6a1f32e751026a151bf481c7219f404a8b22ad7ee8b81acee1c36d991713cf634269728da61dac67f8922d3467d238f3a6d2a3920e7a7684039a8e248d847974ab2c502542bdb2857af42de4c984e4544848ab642064bea4ecef95dc1d32e733c5a1d1ca86adeabaa723a7b00b26c671028550163709e3110f9b8d46439576ebdfd8bac06bab9cdf353bcd06fdeaaa4f10ea240136243530deef0368ff64083c0e268a4053ff39b127603991b2e0e0cde11bb53dcb431e4d323e118722da728cb0228e5cb8d9557ee8e045beb1d368bb8d46b7d96e35956ffcabcfbce12e8f16491032b7a1e8ec3cea2f952ac5da8e36e5beb075b2c24ba94af65c25d9b6cc12fca9fd97d582798cc9b73cccf8285cd31278a347a31cb8b0f2600ba96641c2a39902517a23aa075a69eafc9ed27ff6ab19c57245a69c4278ffc7bd19d5d9088d510c018434590591373bfc5def\",\"6290a4e68f0e71cd4d21ebaebeed5ae39c0fd75bf0f92b24de6cb45a1079f3a0d3ab7fed59cd32a6b24ce4b75c4d4a2133526baafab2abb29e0e2042f1863c30dc39bc7d2a7806f38324af2a2a78599bc74812fa55c59aea55e549e9908e8e12483ba2b45a119ec68bc0ab177b3b6b81af10d64351d148e22c\",\"f2561ec2d255d66888ae1f70765cacbf0d44a09a0688745e686c5d42f0ed56a753ff170fb2053f362879cc9cca63431a245f04bc8bb8c65a0d7bd382f93d4809ae26a5257545d76ac2b6c3fd180514320754a5933bb698c6547032def549198ef56e1a7be9cf1deb640aa85852b4e61d89dcd7ecd33466efb8afc393f2100584b4d3d69da6f371b029c78bf856cc47c00bdaaa7a2f1265cf755d4296ad4eb7fe55e7d9105cb1b5f185bd27b0e35554ca8f2ede6ced18bcdeac3e99b8bf5ed3a53b0aed39da554655e52add82180056802b5ae768707ea282bb0214c810095fed1525f1fd3c28db692f7ba347a5e9940709ebf5486914c003b1ea36d58fe7841fb58076c23cdb0648d68d2b40091431704edf0ff41d8aba970d7cc7edf71a4051e398ae81340f7640584db922834fe1fe31a78be502682d55524d0889c76391a8820edb3bbf7cbf6fa0268038922672d44920a9ecafae8ce454432220b12aa35489f43f9d02c03093878103424320806a1849305763dc66157113a4af0f022c9eac915d6405353608e8a6990eebf6fb74d0405fa4063a3f03b94837fc800a78eada958d9378ae2f561fe12551442bccc94e386521a4750a85d9980ac43c21d4ae88f79031c282ac311754e665ed747d0c61516c0ff15be73012eaaa6dba31ce6e686b664a7bbe6d766b4dcb3fe2f4a9f0b45128dcf764064a5e530aaf36896feb47dab0645df8139ed4615fbcee360f902cb7eb603eccb4ddedf4dd2efedfecf5ebdced3acd66cfeddeb8bd596d9aceadaba18b0436105e066f1c18619e7dd197eee47be681a48b61769581be16d3a701d93a7417c46b6fdc3551053e677076f250286f165ee77316532b054ae807922eeb70df29c9d0ddbaa102bbd19d7312878aa3960498b907b2e9b254b980b27d243c7507ca965398ccca4146237c936e068419699942c8d7da7452387e89ac8c0eab0912c595fc82ab5498e6f10572842f4ad1a19524cdf6ba343da47d46b75496809c414789da8bfc2ce4085fdb69f75b6efddf23fd0dc7fcde4b63e5977b164b3f1654d77d9036811d8557c5f5f29244614eadfabd5a679d57e6b2dead3dabf4a391a7e20ba507f5510697406ae5b65aed56178e6607e780f3e32099237f42e683a0a36c5fd3b586528f8f4f58f96cc0c424f769ad7d49ac447ed1681cb45a5b85cbe70eb38b759a5f132eefee54fa981328babfaf6ec21fed171d1d9aa0c881bdc43f3f7ec72e4f74dc488311e5b44f7a55e5754d726ed34b959f9b4130db309dc6d9646abd784879888a64fc8f38a12cdfd839c985230c3fb61d4229c26ce42771e0b3bded51fbb9e97a26a1218edbd8ab5223c57be0fec00b45bdd9eec35c7af5a2a4e42c75385d6b998894cac63c741ceecf11181dfa019a00131c15239d403a7f203974dcb643d615ee6a242dc2681130482da222ac5ec4045a888916616efb3b4270323dfc49047f427773e832bebd4dc464b2517c6f2bb5689700b07c29a08e0a59aea9bbad9ad8a2d7299c067b9bc4d982c6ad2bbd75cea58f04a0f0d4dd672906ad05c935fb9025914808728070e578557ce6f6f5925075765377f7199d0c52123372216f2188889cfd721ad09d5301210caa7965786354868a350bf41abe1945512baada2201455051358f71b29086ea222f9321bd800909aa33b7553bf88e8c80d85763c35aed9a594d530fad2c86ab5a0a99e4816f1edb70d6ee7d67084be94997dafb25aea1db403ed474f1bb5bffcfeae966a1c23c8e726d307f2c0aac414dd8bb8c4ddd8ce003a3e7079444e9477831c4a623a1aa51925c\",\"8486d404340b1742e1c1177296aa0269c817fa43ca47f83de13e9dcd9645d54d6e95d06198a94749c3e12718fdc6b5655e14087533e15d03b09fb8e4dcd7954a732358dea31a3ddb03f6559e8d50fa851a3e1cce832feab5160fe1da689bf542e00f08803f8b48e6f6839ae46dbebbd99cb2712d6bf1f9034f8336673d7973bd5fa3f880c09c623a3b86cf5597b6207a11720fd4ab4c8ac1764ecede6bab6834f4ce54264ec025fd3a909016bbaa6895928538e8cb5585c99480f264557bbeb668a35ea00112a97a8d676bba6cb4163b387607bac76b393deb5a61ae6b21ee5cb2b7c12d31f3e382bd8f9482160faa8ecd6eff65dcea7118934259bffa83880009379f07b69405b40c9cb50bb0734d2f3ba24a2024be5522b1b32d88daac5dbe00fd357a8da6dbedf49acdfa5fc6b6072dfd39b8a75eac6611501fe5deca824aa62be497680b3c25834fc020afa67357e850affa5c60a647c2f4c614ba451141bbbcf269aeacd323e1f1ca81553a91f8923af1d8990551ddaffb4ee0d7dd46bfd1263fa555e2420d56b2bfc060f67ecc7e2a321505a45a1a48358c5c292216047c0201db81d0a0bf22cebe4086ed46bbd9769bed8ebb51f4faab4efc4081b924f331692acf6b13d5ddca84b9fc20746e3c9e2d7728436188cd2a193398d46d966f4f439e4570a73683dbbe0959bb1f4aa91c9dee5e49694f43ccd10ab5fd30861e781bf7fb609a7d11cf027e7dfdca82aa4df7a45edd4a9586e96ac3ced337c08278a630e98623248cb5feb89610adf478481910f76654692a2e8f6cd501e69952757a1c7bea19784c1783def6634b4a70e9553496a787e3225c087f7dab57eaf24f818cbdb17a118738a5c2b854be9b7b538521a78035c294fa1151d5e98ab4dcedf7fb5f9b5ed5b2d9564ed23a388002770e76e1aca43b744d0c082074e751119c6831f66653ca124cac1b96ed3db00ea844b0c8ca9419be2c59ee421d91f56ed4979f3dd5c33970f719a7f82c3b012a146251c64d4bd51bf8af55fa69e9286d709482381ee154674eeff956c8d1e640cc4ec857c0d7b2bec37902e24a93d45ca6e6329a0b109a329acbccdc92a767869e6744f0f200d56eb73653dbbff4e4ff4ac022a073aeecb6b79e01cb2c59d0c3139f1d2de83d2c8529327395966edc93e93a296509ea017a61f7266156c89cf1b17e8bad0087fae71ebe20e714e9ba88de43bb8fc657a0a168e4a97719c434aba5a5ba2ae59dc64bc70ffcf28186c6f1e4aea8c4e15008118ea2ce910e1dc9b14772a27ebb71d071ad2afd102fe10dd7c193ca3aed52867ac39ca72e1357ff63c2e8c5f1093dce968fdc33347bb67ab1732df1a28b87661f3fbd76b7fe9fe0ddc3f718655de8b1907b6e6f22e8d1cbba4a2a076e3cfedddd45bc4cf8224f135d1d73fc184129b9bfa740f8e02d6f79f74b916404f73bb7811d29295cb1aaeb2e36fe810565be23a103854fff984b45bb6f5d66b7358a3d1c965692ab8fc52dcbd19cff496fd5cd8afbb96e500189fe59143d170f57cf471c2f324530624bbdd14682bb06633fb7f4a33dfb8acfe4aa0abcff2c6e5716b91f25c1c615b24140fddd7835a548b97ed2927fe6d0762f70089cb18508b9594039b930c1e9318cf8d2175ac08814b6dafdfaff9b3b8f23c2c79f6855eeafeff1bf7f028f3203833a380000\"]" + }, + "cookies": [ + { + "expires": "2019-11-14T12:00:00.000Z", + "httpOnly": true, + "name": "WMF-Last-Access", + "path": "/", + "secure": true, + "value": "13-Oct-2019" + }, + { + "domain": ".wikipedia.org", + "expires": "2019-11-14T12:00:00.000Z", + "httpOnly": true, + "name": "WMF-Last-Access-Global", + "path": "/", + "secure": true, + "value": "13-Oct-2019" + }, + { + "domain": ".wikipedia.org", + "name": "GeoIP", + "path": "/", + "secure": true, + "value": "RO:BV:Brasov:45.65:25.61:v4" + } + ], + "headers": [ + { + "name": "date", + "value": "Sun, 13 Oct 2019 12:55:41 GMT" + }, + { + "name": "content-type", + "value": "application/json; charset=utf-8" + }, + { + "name": "transfer-encoding", + "value": "chunked" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "server", + "value": "mw1231.eqiad.wmnet" + }, + { + "name": "x-powered-by", + "value": "PHP/7.2.22-1+0~20190902.26+debian9~1.gbpd64eb7+wmf1" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "p3p", + "value": "CP=\"See https://en.wikipedia.org/wiki/Special:CentralAutoLogin/P3P for more info.\"" + }, + { + "name": "mediawiki-login-suppressed", + "value": "true" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-allow-credentials", + "value": "false" + }, + { + "name": "access-control-expose-headers", + "value": "MediaWiki-API-Error, Retry-After, X-Database-Lag, MediaWiki-Login-Suppressed" + }, + { + "name": "x-frame-options", + "value": "SAMEORIGIN" + }, + { + "name": "content-disposition", + "value": "inline; filename=api-result.json" + }, + { + "name": "vary", + "value": "Accept-Encoding,Treat-as-Untrusted,X-Forwarded-Proto,Cookie,Authorization" + }, + { + "name": "cache-control", + "value": "private, must-revalidate, max-age=0" + }, + { + "name": "backend-timing", + "value": "D=60020 t=1570971341007409" + }, + { + "name": "content-encoding", + "value": "gzip" + }, + { + "name": "x-varnish", + "value": "223258287, 208234782, 485628806" + }, + { + "name": "accept-ranges", + "value": "bytes" + }, + { + "name": "age", + "value": "0" + }, + { + "name": "x-cache", + "value": "cp1083 pass, cp3033 pass, cp3032 pass" + }, + { + "name": "x-cache-status", + "value": "pass" + }, + { + "name": "server-timing", + "value": "cache;desc=\"pass\"" + }, + { + "name": "strict-transport-security", + "value": "max-age=106384710; includeSubDomains; preload" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "WMF-Last-Access=13-Oct-2019;Path=/;HttpOnly;secure;Expires=Thu, 14 Nov 2019 12:00:00 GMT" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "WMF-Last-Access-Global=13-Oct-2019;Path=/;Domain=.wikipedia.org;HttpOnly;secure;Expires=Thu, 14 Nov 2019 12:00:00 GMT" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "GeoIP=RO:BV:Brasov:45.65:25.61:v4; Path=/; secure; Domain=.wikipedia.org" + }, + { + "name": "x-analytics", + "value": "ns=-1;special=Badtitle;https=1;nocookies=1" + }, + { + "name": "x-client-ip", + "value": "82.78.189.22" + } + ], + "headersSize": 1506, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2019-10-13T12:55:40.822Z", + "time": 329, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 329 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/src/page.js b/src/page.js index 795d0dc..9688f8a 100644 --- a/src/page.js +++ b/src/page.js @@ -149,7 +149,7 @@ export default function wikiPage(rawPageInfo, apiOptions) { const filename = getFileName(title); // Some wikis use underscores for spaces, some don't return ( - filename === mainImageName || + filename.toUpperCase() === mainImageName.toUpperCase() || filename.replace(/\s/g, '_') === mainImageName ); }); diff --git a/test/real.js b/test/real.js index 008213f..6aee06b 100644 --- a/test/real.js +++ b/test/real.js @@ -392,4 +392,15 @@ describe('Live tests', () => { refs[3].should.equal('https://www.forbes.com/profile/elon-musk/'); }); }); + + it('should fetch main image #128', () => { + return wiki() + .page('Microsoft') + .then(page => page.mainImage()) + .then(img => { + img.should.equal( + 'https://upload.wikimedia.org/wikipedia/commons/3/30/Building92microsoft.jpg' + ); + }); + }); });