Had an issue with request header "Referer: http://xxxxx.onion.city/path/to/file.html" not being properly replaced to be '.onion' URLs. This change to w2t fixes that. The w2t regex is only used in one place, and you can verify that it gives the correct behavior.
Then rewrote the t2w regex slightly to make it match the w2t regex. Can also verify it does the right thing.
Finally a tweak on ctype's assignment to be prettier.
Had an issue with request header "Referer: http://xxxxx.onion.city/path/to/file.html" not being properly replaced to be '.onion' URLs. This change to w2t fixes that. The w2t regex is only used in one place, and you can verify that it gives the correct behavior.
Then rewrote the t2w regex slightly to make it match the w2t regex. Can also verify it does the right thing.
Finally a tweak on ctype's assignment to be prettier.