Skip to content

Commit

Permalink
ensure the correct http/s protocol is used in report overview (#1832)
Browse files Browse the repository at this point in the history
  • Loading branch information
ballPointPenguin authored Oct 29, 2024
1 parent 497eb03 commit 625b939
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions client-report/src/components/overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ const Overview = ({
{`--------Summary: `}
<a
download={getDownloadFilename("summary", conversation)}
href={`http://${window.location.hostname}/api/v3/reportExport/${report_id}/summary.csv`}
href={`//${window.location.hostname}/api/v3/reportExport/${report_id}/summary.csv`}
type="text/csv"
>
{getDownloadFilename("summary", conversation)}
</a>
Expand All @@ -134,7 +135,8 @@ const Overview = ({
{`-------Comments: `}
<a
download={getDownloadFilename("comments", conversation)}
href={`http://${window.location.hostname}/api/v3/reportExport/${report_id}/comments.csv`}
href={`//${window.location.hostname}/api/v3/reportExport/${report_id}/comments.csv`}
type="text/csv"
>
{getDownloadFilename("comments", conversation)}
</a>
Expand All @@ -144,7 +146,8 @@ const Overview = ({
{`--Votes history: `}
<a
download={getDownloadFilename("votes", conversation)}
href={`http://${window.location.hostname}/api/v3/reportExport/${report_id}/votes.csv`}
href={`//${window.location.hostname}/api/v3/reportExport/${report_id}/votes.csv`}
type="text/csv"
>
{getDownloadFilename("votes", conversation)}
</a>
Expand All @@ -154,7 +157,8 @@ const Overview = ({
{`---Votes matrix: `}
<a
download={getDownloadFilename("participant-votes", conversation)}
href={`http://${window.location.hostname}/api/v3/reportExport/${report_id}/participant-votes.csv`}
href={`//${window.location.hostname}/api/v3/reportExport/${report_id}/participant-votes.csv`}
type="text/csv"
>
{getDownloadFilename("participant-votes", conversation)}
</a>
Expand All @@ -165,16 +169,16 @@ const Overview = ({
<strong>Public API endpoints (read only, Jupyter notebook friendly)</strong>
</p>
<p style={{ fontFamily: "monospace" }}>
{`$ curl http://${window.location.hostname}/api/v3/reportExport/${report_id}/summary.csv`}
{`$ curl ${window.location.protocol}//${window.location.hostname}/api/v3/reportExport/${report_id}/summary.csv`}
</p>
<p style={{ fontFamily: "monospace" }}>
{`$ curl http://${window.location.hostname}/api/v3/reportExport/${report_id}/comments.csv`}
{`$ curl ${window.location.protocol}//${window.location.hostname}/api/v3/reportExport/${report_id}/comments.csv`}
</p>
<p style={{ fontFamily: "monospace" }}>
{`$ curl http://${window.location.hostname}/api/v3/reportExport/${report_id}/votes.csv`}
{`$ curl ${window.location.protocol}//${window.location.hostname}/api/v3/reportExport/${report_id}/votes.csv`}
</p>
<p style={{ fontFamily: "monospace" }}>
{`$ curl http://${window.location.hostname}/api/v3/reportExport/${report_id}/participant-votes.csv`}
{`$ curl ${window.location.protocol}//${window.location.hostname}/api/v3/reportExport/${report_id}/participant-votes.csv`}
</p>
</div>
{doShowDataLicenseTerms && (
Expand Down

0 comments on commit 625b939

Please sign in to comment.