Skip to content

Commit

Permalink
Merge pull request #297 from bdach/fix-bad-mime-type
Browse files Browse the repository at this point in the history
Fix various content type issues on LIO request helpers
  • Loading branch information
peppy authored Nov 15, 2024
2 parents 9e62027 + 90a0989 commit f1a3f2d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
Expand Down Expand Up @@ -120,7 +121,10 @@ public static HttpResponseMessage RunLegacyIO(string command, string method = "G
{
case string postString:
httpRequestMessage.Content = new StringContent(postString);
httpRequestMessage.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("plain/text");
break;

case IEnumerable<KeyValuePair<string, string>> formKeyValuePairs:
httpRequestMessage.Content = new FormUrlEncodedContent(formKeyValuePairs);
break;

default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
// See the LICENCE file in the repository root for full licence text.

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using Dapper;
using JetBrains.Annotations;
using MySqlConnector;
Expand Down Expand Up @@ -112,7 +114,7 @@ private static void adjustGlobalBeatmapPlaycount(SoloScore score, MySqlConnectio

// Reindex beatmap occasionally.
if (RNG.Next(0, 10) == 0)
LegacyDatabaseHelper.RunLegacyIO("indexing/bulk", "POST", $"beatmapset[]={score.beatmap.beatmapset_id}");
LegacyDatabaseHelper.RunLegacyIO("indexing/bulk", "POST", new[] { new KeyValuePair<string, string>("beatmapset[]", score.beatmap.beatmapset_id.ToString(CultureInfo.InvariantCulture)) });

// TODO: announce playcount milestones
// const int notify_amount = 1000000;
Expand Down

0 comments on commit f1a3f2d

Please sign in to comment.