Code Duplication    Length = 6-6 lines in 2 locations

lib/private/AppFramework/Http/Request.php 2 locations

@@ 653-658 (lines=6) @@
650
		}
651
652
		if (isset($this->server['HTTP_X_FORWARDED_PROTO'])) {
653
			if (strpos($this->server['HTTP_X_FORWARDED_PROTO'], ',') !== false) {
654
				$parts = explode(',', $this->server['HTTP_X_FORWARDED_PROTO']);
655
				$proto = strtolower(trim($parts[0]));
656
			} else {
657
				$proto = strtolower($this->server['HTTP_X_FORWARDED_PROTO']);
658
			}
659
660
			// Verify that the protocol is always HTTP or HTTPS
661
			// default to http if an invalid value is provided
@@ 824-829 (lines=6) @@
821
	public function getInsecureServerHost(): string {
822
		$host = 'localhost';
823
		if (isset($this->server['HTTP_X_FORWARDED_HOST'])) {
824
			if (strpos($this->server['HTTP_X_FORWARDED_HOST'], ',') !== false) {
825
				$parts = explode(',', $this->server['HTTP_X_FORWARDED_HOST']);
826
				$host = trim(current($parts));
827
			} else {
828
				$host = $this->server['HTTP_X_FORWARDED_HOST'];
829
			}
830
		} else {
831
			if (isset($this->server['HTTP_HOST'])) {
832
				$host = $this->server['HTTP_HOST'];