Consensys / web3studio-soy

Static Websites on the Distributed Web
https://medium.com/web3studio/soy-is-the-secret-sauce-for-the-unstoppable-web-6e2c1f37430b
33 stars 5 forks source link

Normalize redirect locations to the request uri #47

Closed barlock closed 5 years ago

barlock commented 5 years ago

Related Issue
Supports Consensys/web3studio-website#9

Related PRs
This PR is not dependent on any other PR

What does this PR do?
It maps redirect origin responses back to the requested host path.

This came about as, after deploying to web3studio.eth.soy/web3studio, it would redirect to /ipfs/QmcipiBV7vkJoJuL72yedJ4yWAUhRSDF6itvkvGKyLYPje/web3studio/ instead of /web3studio/ like expected. This should fix that.

Description of Changes
Added an origin-response lambda and cached on host as well as the origin-response contributes to what gets cached. Don't want to redirect poorly!

What gif most accurately describes how I feel towards this PR?
facehoof