Skip to content

Commit

Permalink
fix: resolves #1048
Browse files Browse the repository at this point in the history
  • Loading branch information
CS76 committed Jan 23, 2024
1 parent a81d8c8 commit a7ef632
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/CitationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ public function destroy(Request $request, UpdateProject $updater, Project $proje

return $request->wantsJson() ? new JsonResponse('', 200) : back()->with('success', 'Citation deleted successfully');
}
}
}
2 changes: 1 addition & 1 deletion app/Http/Middleware/HandleInertiaRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ public function share(Request $request)
'DATACITE_API' => env('DATACITE_API'),
]);
}
}
}
10 changes: 8 additions & 2 deletions app/Http/Middleware/XFrameOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,15 @@ public function handle(Request $request, Closure $next): Response
if ($request->route()->getName() == 'embed') {
return $response->header('Content-Security-Policy', 'frame-src data: blob: *');
} else {
$xframeOptions = 'SAMEORIGIN';

return $response->header('X-Frame-Options', $xframeOptions);
if ($response instanceof \Illuminate\Http\Response) {
$xframeOptions = 'SAMEORIGIN';

return $response->header('X-Frame-Options', $xframeOptions);
} else {
return $response;
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ public function down(): void
$table->string('abstract')->nullable();
});
}
};
};

0 comments on commit a7ef632

Please sign in to comment.