Finally finished giant ES6 refactor
This commit is contained in:
parent
c6d48cc424
commit
03e2666958
39 changed files with 553 additions and 635 deletions
|
@ -1,11 +1,11 @@
|
|||
import {parse} from 'url';
|
||||
import { parse } from 'url';
|
||||
import request from 'superagent';
|
||||
|
||||
module.exports = function* (next) {
|
||||
let url = 'http://' + this.request.url.substr(8);
|
||||
let parsed = parse(url);
|
||||
export default function* (next) {
|
||||
const url = 'http://' + this.request.url.substr(8);
|
||||
const parsed = parse(url);
|
||||
if (parsed.host.match(/mzstatic\.com/)) {
|
||||
let proxyResponse = yield request.get(url);
|
||||
const proxyResponse = yield request.get(url);
|
||||
this.set(proxyResponse.headers);
|
||||
this.body = proxyResponse.body;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue