-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Where is HttpContext.Server.HtmlEncode #820
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
There's an HTML encoder that you can acquire through DI. However, depending on where you are in the system, there are often easier ways to get to it. From where do you want to do HTML encoding? An MVC controller? Middleware? A POCO class? |
Eilon, Thank you for the reply. May I have a suggestion here? Could you guys provide a table to show how to do some poplar functions between ASP.NET 4 and 5. It will lower the learning curse and improve the adoption of ASP.NET 5. For example, HTMLEncoding CultureInfo Cache: Thanks lot |
There is Microsoft.Framework.WebEncoders.HtmlEncoder.Default.HtmlEncode(). But where is HtmlDecode? |
@blowdart thoughts on having matching encode/decode APIs for all the encoder stuff? This is all in the BCL now, but we can provide input (and perhaps implementations, if desired). There are currently HTML, JavaScript, and URL encoders here: https://github.com/dotnet/corefx/tree/master/src/System.Text.Encodings.Web/src/System/Text/Encodings/Web. But no decoders. |
We is core duplicating work we have already done? (https://github.com/aspnet/HttpAbstractions/tree/dev/src/Microsoft.Extensions.WebEncoders.Core) There needs to be a sole implementation, and ours, we generate from the specs, so it's up to date. (but yea, there should be decodes too). |
@blowdart we're removing ours and will call into the ones in CoreFx (we moved the code there). Do you want to log a bug for CoreFx on decoders with any relevant info? |
This issue is being closed because it has not been updated in 3 months. We apologize if this causes any inconvenience. We ask that if you are still encountering this issue, please log a new issue with updated information and we will investigate. |
This message was created automatically by mail delivery software.
A message that you sent could not be delivered to one or more of its
recipients. This is a temporary error. The following address(es) deferred:
[email protected]
Domain spinthemoose.com has exceeded the max emails per hour (233/200 (116%)) allowed. Message will be reattempted later
…------- This is a copy of the message, including all the headers. ------
Received: from o3.sgmail.github.com ([192.254.112.98]:1674)
by cp1164.blacksun.ca with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128)
(Exim 4.89_1)
(envelope-from <[email protected]>)
id 1eVkHp-0001Ob-GQ
for [email protected]; Sun, 31 Dec 2017 14:32:49 -0600
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=github.com;
h=from:reply-to:to:cc:in-reply-to:references:subject:mime-version:content-type:content-transfer-encoding:list-id:list-archive:list-post:list-unsubscribe;
s=s20150108; bh=6ZK68B9CENuA146XFeCunUWbSQg=; b=XrO14GHYoNwdpsU3
N9y8ku+UBUcD74xO6lrkJjuBRQ40Jb8uAN0nxEd3UMjjj05YfEtyBWgsHV0Lv5mE
trNqoB6jl63tjvSWSNwyVQ+hPmSz9Ahw5dwL+ZwFDeb+APDfda6f6Gnxhes6AfIN
OBobGKupnANCA/ZXz8+A9yGDR2c=
Received: by filter0628p1mdw1.sendgrid.net with SMTP id filter0628p1mdw1-4808-5A49495B-F
2017-12-31 20:32:27.868918835 +0000 UTC
Received: from github-smtp2b-ext-cp1-prd.iad.github.net (github-smtp2b-ext-cp1-prd.iad.github.net [192.30.253.17])
by ismtpd0010p1iad1.sendgrid.net (SG) with ESMTP id 5MUlApySSNqpXLG52m0d8Q
for <[email protected]>; Sun, 31 Dec 2017 20:32:27.865 +0000 (UTC)
Date: Sun, 31 Dec 2017 20:32:27 +0000 (UTC)
From: "ASP.NET Hello Bot" <[email protected]>
Reply-To: aspnet/Home <[email protected]>
To: aspnet/Home <[email protected]>
Cc: Subscribed <[email protected]>
Message-ID: <aspnet/Home/issue/820/issue_event/[email protected]>
In-Reply-To: <aspnet/Home/issues/[email protected]>
References: <aspnet/Home/issues/[email protected]>
Subject: Re: [aspnet/Home] Where is HttpContext.Server.HtmlEncode (#820)
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary="--==_mimepart_5a49495bbe268_6b413f8da51e4f34144952d";
charset=UTF-8
Content-Transfer-Encoding: 7bit
Precedence: list
X-GitHub-Sender: aspnet-hello
X-GitHub-Recipient: davidalpert
X-GitHub-Reason: subscribed
List-ID: aspnet/Home <Home.aspnet.github.com>
List-Archive: https://github.com/aspnet/Home
List-Post: <mailto:[email protected]>
List-Unsubscribe: <mailto:unsub+0000a944de8a8b9c07f9755f1981713cf3df5b7965f8101b92cf0000000116610b5b92a169ce05fbc976@reply.github.com>,
<https://github.com/notifications/unsubscribe/AACpREqdNLk3yxHYLkMK8mIIvtTQb7RPks5tF-9bgaJpZM4Fptjq>
X-Auto-Response-Suppress: All
X-GitHub-Recipient-Address: [email protected]
X-SG-EID: rlj3t9ahcX0BZUzAOlajQ3VmBXo43xFJc4M1ImIDJhF3bLhj37LqZbg9uIwfR5UcS1pYcCzO7AVket
iTR5rvzXxEfj9B1p+ZmeRfOxC1/hF+G4hWH3CVrmsUb7ofu3owxMC8EHO3IQsmMq/Q5kpDtmIe/v+N
IY5Cl33+zwJot3Mh7BJkhW6tWwst0KmgRvN6zKcRVxKC/04tX92d3D3oYX/imnHAnSr5XNOqWT+7G2
c=
----==_mimepart_5a49495bbe268_6b413f8da51e4f34144952d
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit
Closed #820.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#820 (comment)
----==_mimepart_5a49495bbe268_6b413f8da51e4f34144952d
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit
<p>Closed <a href="#820" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="100387190" data-permission-text="Issue title is private" data-url="#820>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="#820 (comment) it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AACpRLN9WzmpgQuRM79uSbFYY7NRRy44ks5tF-9bgaJpZM4Fptjq">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AACpRC2HpWXi-6rl_0tYacDJz6BsjqOVks5tF-9bgaJpZM4Fptjq.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="#820 (comment)>
<meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/aspnet/Home","title":"aspnet/Home","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/aspnet/Home"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"Closed #820."}],"action":{"name":"View Issue","url":"#820 (comment)>
----==_mimepart_5a49495bbe268_6b413f8da51e4f34144952d--
|
This message was created automatically by mail delivery software.
A message that you sent could not be delivered to one or more of its
recipients. This is a temporary error. The following address(es) deferred:
[email protected]
Domain spinthemoose.com has exceeded the max emails per hour (232/200 (115%)) allowed. Message will be reattempted later
…------- This is a copy of the message, including all the headers. ------
Received: from github-smtp2-ext7.iad.github.net ([192.30.252.198]:53810 helo=github-smtp2a-ext-cp1-prd.iad.github.net)
by cp1164.blacksun.ca with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256)
(Exim 4.89_1)
(envelope-from <[email protected]>)
id 1eVkHn-0001Oa-WC
for [email protected]; Sun, 31 Dec 2017 14:32:48 -0600
Date: Sun, 31 Dec 2017 12:32:27 -0800
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=github.com;
s=pf2014; t=1514752347;
bh=oMHe7G1NxbM/c+seFtwF8eC7ZTknQgboTcWMpR+HMiI=;
h=From:Reply-To:To:Cc:In-Reply-To:References:Subject:List-ID:
List-Archive:List-Post:List-Unsubscribe:From;
b=OFNZc1xfTqxJ4eVOVdzNT+lTx+gP7QPEcclqytyZ0k2ivkRMWQLTL4ezzO7dSJdBH
+dFJH+bn4a5ZQe3bcnct0l6blLY5uKqN/azHbi7p7wtx6FKjzUYCCoAIp1tYyk4DHN
6ilHYx+/DrBbBbCR3GY5rPEJnjvqeJCLIVYpLCaE=
From: "ASP.NET Hello Bot" <[email protected]>
Reply-To: aspnet/Home <[email protected]>
To: aspnet/Home <[email protected]>
Cc: Subscribed <[email protected]>
Message-ID: <aspnet/Home/issues/820/[email protected]>
In-Reply-To: <aspnet/Home/issues/[email protected]>
References: <aspnet/Home/issues/[email protected]>
Subject: Re: [aspnet/Home] Where is HttpContext.Server.HtmlEncode (#820)
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary="--==_mimepart_5a49495bc5979_60623fc381302f30323a6";
charset=UTF-8
Content-Transfer-Encoding: 7bit
Precedence: list
X-GitHub-Sender: aspnet-hello
X-GitHub-Recipient: davidalpert
X-GitHub-Reason: subscribed
List-ID: aspnet/Home <Home.aspnet.github.com>
List-Archive: https://github.com/aspnet/Home
List-Post: <mailto:[email protected]>
List-Unsubscribe: <mailto:unsub+0000a944de8a8b9c07f9755f1981713cf3df5b7965f8101b92cf0000000116610b5b92a169ce05fbc976@reply.github.com>,
<https://github.com/notifications/unsubscribe/AACpREqdNLk3yxHYLkMK8mIIvtTQb7RPks5tF-9bgaJpZM4Fptjq>
X-Auto-Response-Suppress: All
X-GitHub-Recipient-Address: [email protected]
----==_mimepart_5a49495bc5979_60623fc381302f30323a6
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit
This issue is being closed because it has not been updated in 3 months.
We apologize if this causes any inconvenience. We ask that if you are still encountering this issue, please log a new issue with updated information and we will investigate.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#820 (comment)
----==_mimepart_5a49495bc5979_60623fc381302f30323a6
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<p>This issue is being closed because it has not been updated in 3 months=
.</p>
<p>We apologize if this causes any inconvenience. We ask that if you are =
still encountering this issue, please log a new issue with updated inform=
ation and we will investigate.</p>
<p style=3D"font-size:small;-webkit-text-size-adjust:none;color:#666;">&m=
dash;<br />You are receiving this because you are subscribed to this thre=
ad.<br />Reply to this email directly, <a href=3D"https://github.com/aspn=
et/Home/issues/820#issuecomment-354622617">view it on GitHub</a>, or <a h=
ref=3D"https://github.com/notifications/unsubscribe-auth/AACpRLN9WzmpgQuR=
M79uSbFYY7NRRy44ks5tF-9bgaJpZM4Fptjq">mute the thread</a>.<img alt=3D"" h=
eight=3D"1" src=3D"https://github.com/notifications/beacon/AACpRC2HpWXi-6=
rl_0tYacDJz6BsjqOVks5tF-9bgaJpZM4Fptjq.gif" width=3D"1" /></p>
<div itemscope itemtype=3D"http://schema.org/EmailMessage">
<div itemprop=3D"action" itemscope itemtype=3D"http://schema.org/ViewActi=
on">
<link itemprop=3D"url" href=3D"#82
0#issuecomment-354622617"></link>
<meta itemprop=3D"name" content=3D"View Issue"></meta>
</div>
<meta itemprop=3D"description" content=3D"View this Issue on GitHub"></me=
ta>
</div>
<script type=3D"application/json" data-scope=3D"inboxmarkup">{"api_versio=
n":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name"=
:"GitHub"},"entity":{"external_key":"github/aspnet/Home","title":"aspnet/=
Home","subtitle":"GitHub repository","main_image_url":"https://cloud.gith=
ubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c=
7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/=
143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name=
":"Open in GitHub","url":"https://github.com/aspnet/Home"}},"updates":{"s=
nippets":[{"icon":"PERSON","message":"@aspnet-hello in #820: This issue i=
s being closed because it has not been updated in 3 months.\r\n\r\nWe apo=
logize if this causes any inconvenience. We ask that if you are still enc=
ountering this issue, please log a new issue with updated information and=
we will investigate.\r\n"}],"action":{"name":"View Issue","url":"https:/=
/github.com/aspnet/Home/issues/820#issuecomment-354622617"}}}</script>=
----==_mimepart_5a49495bc5979_60623fc381302f30323a6--
|
How can I do HtmlEncode now in ASP.NET 5?
Thank you
Gary
The text was updated successfully, but these errors were encountered: