Skip to content

Commit 0824e7e

Browse files
committed
Fix TCP proxy to pass through responses without Content-Type header
When no Content-Type header is present, default to binary pass-through instead of attempting URL rewriting. DLNA text responses (XML) always include Content-Type headers, while media streams (like DVB) may omit them. Fixes #4
1 parent 3c624bc commit 0824e7e

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44

55
This project is a fork of [Nic0w/dlnaproxy](https://github.com/Nic0w/dlnaproxy).
66

7+
## [0.4.5] - 2026-01-09
8+
9+
### Fixed
10+
11+
- **TCP proxy: default to binary pass-through when Content-Type is missing**: Responses without a Content-Type header are now passed through unchanged instead of attempting URL rewriting. This fixes streaming from DVB and other servers that don't send Content-Type headers for media streams.
12+
713
## [0.4.4] - 2026-01-09
814

915
### Fixed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "dlna-proxy"
3-
version = "0.4.4"
3+
version = "0.4.5"
44
authors = ["Nic0w", "Bartosz Fenski <fenio@debian.org>"]
55
edition = "2021"
66
description = "A DLNA proxy that enables use of a DLNA server past the local network boundary"

src/tcp_proxy.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,10 @@ fn should_rewrite_content(headers: &str) -> bool {
191191
|| content_type.contains("html");
192192
}
193193
}
194-
// If no Content-Type header, assume it might be text (for compatibility)
195-
true
194+
// If no Content-Type header, default to binary pass-through.
195+
// DLNA text responses (XML) always have Content-Type headers,
196+
// while media streams may omit them.
197+
false
196198
}
197199

198200
/// Proxy HTTP responses from origin to client, rewriting URLs in the body

0 commit comments

Comments
 (0)