fix: properly extract path and query from URL