"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Duplicati/Server/WebServer/Server.cs" between
duplicati- and duplicati-

About: Duplicati is a backup client that securely stores encrypted, incremental, compressed backups on local devices, cloud storage services and remote file servers (for Windows, macOS and Linux). A remark: This officially "pre-release" seems to run stable.

Server.cs  (duplicati-  (duplicati-
´╗┐using System; ´╗┐using System;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using HttpServer.HttpModules; using HttpServer.HttpModules;
using System.Security.Cryptography.X509Certificates; using System.Security.Cryptography.X509Certificates;
using Duplicati.Library.Common.IO; using Duplicati.Library.Common.IO;
namespace Duplicati.Server.WebServer namespace Duplicati.Server.WebServer
{ {
public class Server public class Server
{ {
skipping to change at line 401 skipping to change at line 402
response.Status = System.Net.HttpStatusCode.Forbidden; response.Status = System.Net.HttpStatusCode.Forbidden;
var msg = System.Text.Encoding.ASCII.GetBytes(response.Reaso n); var msg = System.Text.Encoding.ASCII.GetBytes(response.Reaso n);
response.ContentType = "text/plain"; response.ContentType = "text/plain";
response.ContentLength = msg.Length; response.ContentLength = msg.Length;
response.Body.Write(msg, 0, msg.Length); response.Body.Write(msg, 0, msg.Length);
response.Send(); response.Send();
return true; return true;
} }
// Check the hostnames we always allow // Check the hostnames we always allow
if (Array.IndexOf(DEFAULT_ALLOWED, host) >= 0) if (DEFAULT_ALLOWED.Contains(host, StringComparer.OrdinalIgnoreC ase))
return false; return false;
// Then the user specified ones // Then the user specified ones
if (h != null && Array.IndexOf(h, host) >= 0) if (h != null && h.Contains(host, StringComparer.OrdinalIgnoreCa se))
return false; return false;
// Disable checks if we have an asterisk // Disable checks if we have an asterisk
if (h != null && Array.IndexOf(h, "*") >= 0) if (h != null && Array.IndexOf(h, "*") >= 0)
return false; return false;
// Finally, check if we have a potential IP address // Finally, check if we have a potential IP address
var v4 = IPV4.Match(host); var v4 = IPV4.Match(host);
var v6 = IPV6.Match(host); var v6 = IPV6.Match(host);
 End of changes. 3 change blocks. 
2 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)