[PR #1229] [MERGED] Cleaning WebSocketSharp continued #8703

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

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/1229
Author: @voodoos
Created: 4/12/2019
Status: Merged
Merged: 5/9/2019
Merged by: @Bond-009

Base: masterHead: cleanup/SocketSharp


📝 Commits (5)

  • 5f6ab83 Extend Microsoft.Net.Http.Headers.HeaderNames
  • a6e1b23 Simplify headers use in WSS
  • 56d1050 Replace custom ip "normalization" by methods from IPAddress
  • bb80755 Replace CRLF injection mitigation by use of .NET ip parsing
  • ba12d96 Removed wrapping of HeaderNames fields

📊 Changes

3 files changed (+26 additions, -115 deletions)

View changed files

📝 Emby.Server.Implementations/SocketSharp/WebSocketSharpRequest.cs (+15 -95)
MediaBrowser.Common/Net/CustomHeaderNames.cs (+11 -0)
📝 MediaBrowser.Model/Services/IHttpRequest.cs (+0 -20)

📄 Description

More cleaning of the WebSocketSharp class.

Changes

  • Added a class wrapping and extending HeaderNames in an attempt to answer #1046. Had to create a wrapper because it is (so-far) not possible to extend or inherit static classes. Not sure if this is a good solution though.
  • Replaced custom NormalizeIP code with adequate .NET Core methods.
  • Remove character-checking code probably mitigating CRLF injections and replaced it by calls to IPRemote.TryParsewhich checks if a string is a valid IP or not.

Issues
Fixes #1046


🔄 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/1229 **Author:** [@voodoos](https://github.com/voodoos) **Created:** 4/12/2019 **Status:** ✅ Merged **Merged:** 5/9/2019 **Merged by:** [@Bond-009](https://github.com/Bond-009) **Base:** `master` ← **Head:** `cleanup/SocketSharp` --- ### 📝 Commits (5) - [`5f6ab83`](https://github.com/jellyfin/jellyfin/commit/5f6ab836dea4341844f1e1e5a1e1d45c7c6621c1) Extend Microsoft.Net.Http.Headers.HeaderNames - [`a6e1b23`](https://github.com/jellyfin/jellyfin/commit/a6e1b23eb04d620e241e4babbcb6ee0ffbf156a9) Simplify headers use in WSS - [`56d1050`](https://github.com/jellyfin/jellyfin/commit/56d1050bac3a56249acd7f3b3615f796683e0783) Replace custom ip "normalization" by methods from `IPAddress` - [`bb80755`](https://github.com/jellyfin/jellyfin/commit/bb807554e2c33f066402898a3ff79913865d50e3) Replace CRLF injection mitigation by use of .NET ip parsing - [`ba12d96`](https://github.com/jellyfin/jellyfin/commit/ba12d96d23a53ce16a1da1b2fcf68a301050b858) Removed wrapping of HeaderNames fields ### 📊 Changes **3 files changed** (+26 additions, -115 deletions) <details> <summary>View changed files</summary> 📝 `Emby.Server.Implementations/SocketSharp/WebSocketSharpRequest.cs` (+15 -95) ➕ `MediaBrowser.Common/Net/CustomHeaderNames.cs` (+11 -0) 📝 `MediaBrowser.Model/Services/IHttpRequest.cs` (+0 -20) </details> ### 📄 Description More cleaning of the WebSocketSharp class. **Changes** - Added a class ~~wrapping and~~ extending `HeaderNames` in an attempt to answer #1046. ~~Had to create a wrapper because it is (so-far) not possible to extend or inherit static classes. Not sure if this is a good solution though.~~ - Replaced custom `NormalizeIP` code with adequate .NET Core methods. - Remove character-checking code probably mitigating CRLF injections and replaced it by calls to `IPRemote.TryParse`which checks if a string is a valid IP or not. **Issues** Fixes #1046 --- <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 05:48: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#8703