Skip to content

Commit

Permalink
set headers properly
Browse files Browse the repository at this point in the history
  • Loading branch information
drkameleon committed Nov 14, 2023
1 parent f635250 commit 129e71f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions website/download.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
$ver = $_GET["ver"];
$mgk = $_GET["mgk"];

header("Access-Control-Allow-Origin: *");

if (($pkg != "") && ($ver != "") && ($mgk == "18966")) {
if ((is_dir("/var/www/pkgr.art/public/" . $pkg)) &&
(is_dir("/var/www/pkgr.art/public/" . $pkg . "/" . $ver))) {
Expand Down
4 changes: 4 additions & 0 deletions website/getdownloads.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<?php

$http_origin = $_SERVER['HTTP_ORIGIN'];

$pkg = $_GET["pkg"];

if ($pkg != "") {
if (is_dir("/var/www/pkgr.art/public/" . $pkg)) {
header("Access-Control-Allow-Origin: $http_origin");

$cnt = 0;
$files = glob("/var/www/pkg_stats/" . $pkg . "-*");

Expand Down

0 comments on commit 129e71f

Please sign in to comment.