varnishcache-friends / varnish3to4

Varnish 3 to 4 migration script
BSD 2-Clause "Simplified" License
125 stars 25 forks source link

attempt to fix https://github.com/fgsch/varnish3to4/issues/4 #7

Closed mbekkelund closed 7 years ago

mbekkelund commented 7 years ago

I think this change should do it. Atleast it seems to work with my test-files.

$ ./varnish3to4 -o test_v4 test_v3
$ cat test_v3
   error 751 "http://" + req.url;
$ cat test_v4
   return (synth(751, "http://" + req.url));

It also works with no arguments.

fgsch commented 7 years ago

Not quite:

error 101 "depeche;mode"

gives:

error 101 "depeche

mbekkelund commented 7 years ago

Ok, thanks fgsch, I took another look at it now. Do you see any possible pitfalls in the second commit?

09:53 $ cat test_v3
error 101 "http://example";
error 202 "http://example" + req.url;
error 303 "http://porcupine;tree" + req.url;
error 404 "http://porcupine;tree;fear?of+a#blank&planet@" + req.url + req.something;
09:53 $ cat test_v4
return (synth(101, "http://example"));
return (synth(202, "http://example" + req.url));
return (synth(303, "http://porcupine;tree" + req.url));
return (synth(404, "http://porcupine;tree;fear?of+a#blank&planet@" + req.url + req.something));
fgsch commented 7 years ago

Looks good.

Could you squash the commits and improve the commit message?

mbekkelund commented 7 years ago

Ok, squashed and improved commit message.

fgsch commented 7 years ago

Applied with some tweaks in the commit message.

Thanks for the PR.