Skip to content

Commit

Permalink
Use UriEscapeDataString for data strings
Browse files Browse the repository at this point in the history
- Current code causes an error on test runs on CI, not sure
  if this is a reason, but let's try.
  • Loading branch information
AndersAbel committed Sep 25, 2018
1 parent 01e0a0b commit 221ca04
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Sustainsys.Saml2/WebSSO/Saml2RedirectBinding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,8 @@ public override UnbindResult Unbind(HttpRequestData request, IOptions options)
}
catch(FormatException ex)
{
throw new FormatException($"\"{encodedPayload}\" is not a valid Base64 encoded string: {ex.Message}", ex);
throw new FormatException($"\'{encodedPayload}\' is not a valid Base64 encoded string: {ex.Message}", ex);
}

}

private static TrustLevel GetTrustLevel(XmlElement documentElement, HttpRequestData request, IOptions options)
Expand Down Expand Up @@ -190,7 +189,7 @@ private static string Serialize(string payload)
writer.Write(payload);
}

return System.Net.WebUtility.UrlEncode(Convert.ToBase64String(compressed.GetBuffer(), 0, (int)compressed.Length));
return Uri.EscapeDataString(Convert.ToBase64String(compressed.GetBuffer(), 0, (int)compressed.Length));
}
}

Expand Down

0 comments on commit 221ca04

Please sign in to comment.