Commonize http-request-handler from s3-api and rest-api(4)