Skip to content

Commit

Permalink
Update amp-first example to use GSSP (#11028)
Browse files Browse the repository at this point in the history
  • Loading branch information
ragingwind committed Mar 13, 2020
1 parent c135830 commit b092ff7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/amp-first/pages/index.js
Expand Up @@ -234,10 +234,10 @@ const Home = props => (
)

// amp-script requires absolute URLs, so we create a property `host` which we can use to calculate the script URL.
Home.getInitialProps = async ({ req }) => {
export async function getServerSideProps({ req }) {
// WARNING: This is a generally unsafe application unless you're deploying to a managed platform like ZEIT Now.
// Be sure your load balancer is configured to not allow spoofed host headers.
return { host: `${getProtocol(req)}://${req.headers.host}` }
return { props: { host: `${getProtocol(req)}://${req.headers.host}` } }
}

function getProtocol(req) {
Expand Down

0 comments on commit b092ff7

Please sign in to comment.