
import url from 'url';
import proxy from './proxy';

const atob = (base64String = '') =>
	(new Buffer(base64String, 'base64')).toString('utf-8')
;

export default () => proxy((ctx) => {
	const pathname = url.parse(ctx.req.url).pathname.slice(1);
	const target = decodeURI(atob(pathname));
	delete ctx.req.headers.referer;
	return {
		target,
		changeOrigin: true,
		hostRewrite: false,
	};
});

@@ -362,30 +362,8 @@
 ue,%0A
-%09%09hostRewrite: false,%0A
 %09%7D;%0A

update urlProxy plugin