Skip to content

Commit 44ecc1c

Browse files
committed
Added port to Referer header if exists
1 parent 50154f7 commit 44ecc1c

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/Resource/ResourceFactory.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,16 @@ public function createResourceFromFile(PathInfoInterface $pathInfo, string $file
105105
$parsedUrl = parse_url($filename) ?: [];
106106

107107
if (isset($parsedUrl['scheme'], $parsedUrl['host'])) {
108+
$host = $parsedUrl['host'];
109+
110+
if (isset($parsedUrl['port'])) {
111+
$host .= ':' . $parsedUrl['port'];
112+
}
113+
108114
$headers[] = sprintf(
109115
"Referer: %s://%s\r\n",
110116
$parsedUrl['scheme'],
111-
$parsedUrl['host'],
117+
$host,
112118
);
113119
}
114120

0 commit comments

Comments
 (0)