dpc-sdp / ripple

Ripple is the frontend framework for Single Digital Presence, delivered using Nuxt and Vue.js
Apache License 2.0
61 stars 37 forks source link

getBaseUrl incorrectly setting the request protocol #1201

Open dylankelly opened 2 years ago

dylankelly commented 2 years ago

See https://digital-engagement.atlassian.net/browse/SDPSUP-4331

Requests made in HTTPS environments are not correctly setting the baseUrl for requests to the ripple-search-api endpoint when used in a secure HTTPS environment.

See https://github.com/dpc-sdp/ripple/blob/develop/packages/ripple-nuxt-tide/lib/templates/plugin.js#L25

Suggested solution

Check req has secure property set and use that instead.

See https://stackoverflow.com/questions/10348906/how-to-know-if-a-request-is-http-or-https-in-node-js