зеркало из https://github.com/dotnet/aspnetcore.git
Merge branch 'merge/release/2.2-to-master' of https://github.com/dotnet-maestro-bot/AspNetCore into merge/release/2.2-to-master
This commit is contained in:
Коммит
b2ee8e6b66
|
@ -49,11 +49,21 @@ namespace Microsoft.AspNetCore.Identity.Test
|
|||
|
||||
private async Task<string> GetShaIntegrity(ScriptTag scriptTag)
|
||||
{
|
||||
var prefix = scriptTag.Integrity.Substring(0, 6);
|
||||
var isSha256 = scriptTag.Integrity.StartsWith("sha256");
|
||||
var prefix = isSha256 ? "sha256" : "sha384";
|
||||
using (var respStream = await _httpClient.GetStreamAsync(scriptTag.Src))
|
||||
using (HashAlgorithm alg = string.Equals(prefix, "sha256") ? (HashAlgorithm)SHA256.Create() : (HashAlgorithm)SHA384.Create())
|
||||
using (var alg256 = SHA256.Create())
|
||||
using (var alg384 = SHA384.Create())
|
||||
{
|
||||
var hash = alg.ComputeHash(respStream);
|
||||
byte[] hash;
|
||||
if(isSha256)
|
||||
{
|
||||
hash = alg256.ComputeHash(respStream);
|
||||
}
|
||||
else
|
||||
{
|
||||
hash = alg384.ComputeHash(respStream);
|
||||
}
|
||||
return $"{prefix}-" + Convert.ToBase64String(hash);
|
||||
}
|
||||
}
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -27,7 +27,7 @@
|
|||
"rxjs": "^6.0.0",
|
||||
"zone.js": "^0.8.26",
|
||||
"aspnet-prerendering": "^3.0.1",
|
||||
"bootstrap": "^4.1.3",
|
||||
"bootstrap": "^4.3.1",
|
||||
"jquery": "3.3.1",
|
||||
"popper.js": "^1.14.3"
|
||||
},
|
||||
|
|
|
@ -267,6 +267,13 @@ export class MessagePackHubProtocol implements IHubProtocol {
|
|||
return BinaryMessageFormat.write(payload.slice());
|
||||
}
|
||||
|
||||
private writeCancelInvocation(cancelInvocationMessage: CancelInvocationMessage): ArrayBuffer {
|
||||
const msgpack = msgpack5();
|
||||
const payload = msgpack.encode([MessageType.CancelInvocation, cancelInvocationMessage.headers || {}, cancelInvocationMessage.invocationId]);
|
||||
|
||||
return BinaryMessageFormat.write(payload.slice());
|
||||
}
|
||||
|
||||
private readHeaders(properties: any): MessageHeaders {
|
||||
const headers: MessageHeaders = properties[1] as MessageHeaders;
|
||||
if (typeof headers !== "object") {
|
||||
|
|
|
@ -76,8 +76,8 @@ export function formatArrayBuffer(data: ArrayBuffer): string {
|
|||
export function isArrayBuffer(val: any): val is ArrayBuffer {
|
||||
return val && typeof ArrayBuffer !== "undefined" &&
|
||||
(val instanceof ArrayBuffer ||
|
||||
// Sometimes we get an ArrayBuffer that doesn't satisfy instanceof
|
||||
(val.constructor && val.constructor.name === "ArrayBuffer"));
|
||||
// Sometimes we get an ArrayBuffer that doesn't satisfy instanceof
|
||||
(val.constructor && val.constructor.name === "ArrayBuffer"));
|
||||
}
|
||||
|
||||
/** @private */
|
||||
|
|
Загрузка…
Ссылка в новой задаче