[PR #5824] [CLOSED] Handle symbolic links as source files #10680

Closed
opened 2026-02-07 06:24:50 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/5824
Author: @ralf1070
Created: 4/15/2021
Status: Closed

Base: masterHead: symlink


📝 Commits (1)

  • 18c0824 Handle symbolic links as source files

📊 Changes

1 file changed (+21 additions, -0 deletions)

View changed files

📝 Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs (+21 -0)

📄 Description

When replaying content via DLNA 'Microsoft.AspNetCore.Http.SendFileResponseExtensions.SendFileAsyncCore'
validates the length of the sent information. Unfortuanately this check fails for source files
which are symbolic links (aka ReparsePoint's). In this case the size of the filename of the referenced
file is reported, instead of the size of the content of this file.

  • To fix this in AspNetCore.Http would be best, but is out of scope.
  • Second best would be, to resolve the symbolic link target and return this as PhysicalFileResult. This
    would require to add Mono.Posix to this project, which would add another Assembly and which is - as far
    as I know - not portable to Windows and therefore would require conditional compilation.
  • The third way is to use FileStreamResult for files known to be symbolic links, as it correctly reports
    the size of the open file. For all other files PhysicalFileResult is kept, as other parts of this
    project may rely on using it's properties.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jellyfin/jellyfin/pull/5824 **Author:** [@ralf1070](https://github.com/ralf1070) **Created:** 4/15/2021 **Status:** ❌ Closed **Base:** `master` ← **Head:** `symlink` --- ### 📝 Commits (1) - [`18c0824`](https://github.com/jellyfin/jellyfin/commit/18c0824fbada2c065d903810cd953e1e93da3a40) Handle symbolic links as source files ### 📊 Changes **1 file changed** (+21 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs` (+21 -0) </details> ### 📄 Description When replaying content via DLNA 'Microsoft.AspNetCore.Http.SendFileResponseExtensions.SendFileAsyncCore' validates the length of the sent information. Unfortuanately this check fails for source files which are symbolic links (aka ReparsePoint's). In this case the size of the filename of the referenced file is reported, instead of the size of the content of this file. * To fix this in AspNetCore.Http would be best, but is out of scope. * Second best would be, to resolve the symbolic link target and return this as PhysicalFileResult. This would require to add Mono.Posix to this project, which would add another Assembly and which is - as far as I know - not portable to Windows and therefore would require conditional compilation. * The third way is to use FileStreamResult for files known to be symbolic links, as it correctly reports the size of the open file. For all other files PhysicalFileResult is kept, as other parts of this project may rely on using it's properties. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-07 06:24:50 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#10680