mirror of
https://github.com/openbullet/openbullet.git
synced 2023-10-21 07:33:42 -05:00
Fixed (very dirty) encode content in Request Block.
This commit is contained in:
@@ -271,7 +271,7 @@ KEYCHECK BanOnToCheck=False
|
||||
This will spawn and execute a Request Block.
|
||||
|
||||
Syntax (expanded for readability):
|
||||
REQUEST METHOD "URL" [AutoRedirect?] [ReadResponseSource?] [ParseQuery?] [EncodeOutput?]
|
||||
REQUEST METHOD "URL" [AutoRedirect?] [ReadResponseSource?] [ParseQuery?] [EncodeContent?]
|
||||
[STANDARD / MULTIPART / BASICAUTH]
|
||||
[CONTENT "postdata"]
|
||||
[CONTENTTYPE "ctype"]
|
||||
|
||||
@@ -10,7 +10,7 @@ KEYCHECK [BanOn4XX?] [BanOnToCheck?]
|
||||
]*
|
||||
</item>
|
||||
<item name="REQUEST">
|
||||
REQUEST METHOD "URL" [AutoRedirect?] [ReadResponseSource?] [ParseQuery?] [EncodeOutput?]
|
||||
REQUEST METHOD "URL" [AutoRedirect?] [ReadResponseSource?] [ParseQuery?] [EncodeContent?]
|
||||
[STANDARD / MULTIPART / BASICAUTH]
|
||||
[CONTENT "postdata"]
|
||||
[CONTENTTYPE "ctype"]
|
||||
|
||||
@@ -393,7 +393,14 @@ namespace RuriLib
|
||||
.Select(p => ReplaceValues(p, data)));
|
||||
if (pData != "")
|
||||
{
|
||||
if (encodeContent) pData = System.Uri.EscapeDataString(pData);
|
||||
if (encodeContent)
|
||||
{
|
||||
// Very dirty but it works
|
||||
var nonce = data.rand.Next(1000000, 9999999);
|
||||
pData = pData.Replace("&", $"{nonce}&{nonce}").Replace("=", $"{nonce}={nonce}");
|
||||
pData = System.Uri.EscapeDataString(pData).Replace($"{nonce}%26{nonce}", "&").Replace($"{nonce}%3D{nonce}", "=");
|
||||
}
|
||||
|
||||
content = new StringContent(pData);
|
||||
content.ContentType = cType;
|
||||
data.Log(new LogEntry(string.Format("Post Data: {0}", pData), Colors.MediumTurquoise));
|
||||
|
||||
Reference in New Issue
Block a user