* fix: url handling in State to distinguish http/https origins * fix: tests * chore: parse URL in a better way