Rewriting Request logic for supporting internal and external requests