fixed href determination in ResourceHandler