Use tempurl middleware

Change-Id: Ie4b6ab3e2fe877563df8c91cefeafc996be70f37