Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,6 @@
<Compile Remove="commands\utility\ShowCommand\ShowCommandProxy.cs" />
<Compile Remove="commands\utility\update-list.cs" />
<Compile Remove="singleshell\installer\MshUtilityMshSnapin.cs" />
<Compile Remove="commands\utility\WebCmdlet\FullClr\BasicHtmlWebResponseObject.FullClr.cs" />
<Compile Remove="commands\utility\WebCmdlet\FullClr\ContentHelper.FullClr.cs" />
<Compile Remove="commands\utility\WebCmdlet\FullClr\HtmlWebResponseObject.FullClr.cs" />
<Compile Remove="commands\utility\WebCmdlet\FullClr\InvokeRestMethodCommand.FullClr.cs" />
<Compile Remove="commands\utility\WebCmdlet\FullClr\InvokeWebRequestCommand.FullClr.cs" />
<Compile Remove="commands\utility\WebCmdlet\FullClr\JsonObjectTypeResolver.cs" />
<Compile Remove="commands\utility\WebCmdlet\FullClr\WebRequestPSCmdlet.FullClr.cs" />
<Compile Remove="commands\utility\WebCmdlet\FullClr\WebResponseHelper.FullClr.cs" />
<Compile Remove="commands\utility\WebCmdlet\FullClr\WebResponseObject.FullClr.cs" />
<Compile Remove="commands\utility\WebCmdlet\FullClr\WebResponseObjectFactory.FullClr.cs" />
<Compile Remove="commands\utility\WebCmdlet\CoreCLR\HtmlWebResponseObject.CoreClr.cs" />
<Compile Remove="gen\FormatAndOut_out_gridview.cs" />
<Compile Remove="gen\UtilityMshSnapinResources.cs" />
<Compile Remove="gen\OutPrinterDisplayStrings.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System;
using System.Management.Automation;
using System.Net;
using System.Net.Http;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
Expand All @@ -16,7 +17,7 @@ namespace Microsoft.PowerShell.Commands
/// <summary>
/// Response object for html content without DOM parsing
/// </summary>
public partial class BasicHtmlWebResponseObject : WebResponseObject
public class BasicHtmlWebResponseObject : WebResponseObject
{
#region Properties

Expand Down Expand Up @@ -116,6 +117,31 @@ public WebCmdletElementCollection Images

#endregion Properties

#region Constructors

/// <summary>
/// Constructor for BasicHtmlWebResponseObject
/// </summary>
/// <param name="response"></param>
public BasicHtmlWebResponseObject(HttpResponseMessage response)
: this(response, null)
{ }

/// <summary>
/// Constructor for HtmlWebResponseObject with memory stream
/// </summary>
/// <param name="response"></param>
/// <param name="contentStream"></param>
public BasicHtmlWebResponseObject(HttpResponseMessage response, Stream contentStream)
: base(response, contentStream)
{
EnsureHtmlParser();
InitializeContent();
InitializeRawContent(response);
}

#endregion Constructors

#region Private Fields

private static Regex s_tagRegex;
Expand Down Expand Up @@ -242,6 +268,13 @@ protected void InitializeContent()
}
}

private void InitializeRawContent(HttpResponseMessage baseResponse)
{
StringBuilder raw = ContentHelper.GetRawContentHeader(baseResponse);
raw.Append(Content);
this.RawContent = raw.ToString();
}

#endregion Methods
}
}
Loading