Skip to content

Commit 4c88e0f

Browse files
authored
260: Fixes pdf viewer path and cors error on prod (#261)
1 parent c21b9a2 commit 4c88e0f

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

cdk/ingest/buckets.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ export default class IngestBuckets extends Construct {
3939
{
4040
allowedHeaders: ['Authorization'],
4141
allowedMethods: [HttpMethods.GET, HttpMethods.HEAD],
42-
allowedOrigins: [`https://${websiteDistribution.distributionDomainName}`],
42+
allowedOrigins: [
43+
`https://${websiteDistribution.distributionDomainName}`,
44+
'https://search.oceanbestpractices.org',
45+
],
4346
maxAge: 3000,
4447
},
4548
],

website/src/js/components/Result.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Result extends Component {
4242
formatStatisticsUrl(handle) {
4343
return `https://repository.oceanbestpractices.org/handle/${handle}/statistics`
4444
}
45-
45+
4646
hashLinkScroll() {
4747
const { hash } = window.location;
4848
if (hash !== '') {
@@ -98,7 +98,7 @@ class Result extends Component {
9898
}
9999

100100
launchPDF() {
101-
const pdfURL = `viewer/index.html?file=https://s3.amazonaws.com/${documentBucketSource}-document-source/${this.props.uuid}.pdf&search=${constructViewerQuery(this.props.searchReducer.activeSearch, false)}`;
101+
const pdfURL = `viewer/index.html?file=https://s3.amazonaws.com/${documentBucketSource}-document-source/pdf/${this.props.uuid}.pdf&search=${constructViewerQuery(this.props.searchReducer.activeSearch, false)}`;
102102
window.open(pdfURL, '_blank');
103103
this.setState({showDocument: true});
104104
}
@@ -210,7 +210,7 @@ class Result extends Component {
210210
export_citation_checkbox
211211
}
212212
{ result_title }
213-
213+
214214
<div className="result__author">
215215
{
216216
authorList || null

0 commit comments

Comments
 (0)