Skip to content
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

Add custom domain support #108

Merged
merged 2 commits into from
Apr 4, 2024
Merged

Add custom domain support #108

merged 2 commits into from
Apr 4, 2024

Conversation

MingweiSamuel
Copy link
Owner

From #103

@MingweiSamuel
Copy link
Owner Author

testing csharp uri code
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Web;
					
public class Program
{
	public static void Main()
	{
		string longurl = "http://somesite.example/news.php?article=1&lang=en";
		var uriBuilder = new UriBuilder(longurl);
		var query = HttpUtility.ParseQueryString(uriBuilder.Query);
		query["action"] = "🤣";
		query["attempts"] = "11";
		query["attempts"] = "12";
		query.Add("attempts", "15");
		query.Add("🤣", "15");
		Console.WriteLine(query.ToString());
		uriBuilder.Query = query.ToString();
		longurl = uriBuilder.ToString();
		Console.WriteLine(longurl);
		
		var queryParams = new List<KeyValuePair<string?, string?>>();
		var content = new FormUrlEncodedContent(queryParams);
		Console.WriteLine(content.ReadAsStringAsync().Result);
		
		var req = new HttpRequestMessage(HttpMethod.Get, "/riot/account/v1/active-shards/by-game/by-puuid?hello=world");
		Console.WriteLine(req.ToString());
		Console.WriteLine(req.RequestUri.ToString());
		
		Uri uri = new Uri(req.RequestUri.ToString(), UriKind.RelativeOrAbsolute);
		Console.WriteLine(uri.ToString());
		
		var builder = new UriBuilder(uri);
		Console.WriteLine(builder.ToString());
	}
}

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.csproj.xml" />
<PropertyGroup>
<TargetFrameworks>netstandard1.1;net45;net461;netstandard2.1;netcoreapp3.1;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net45;net461;netstandard2.1;netcoreapp3.1;net6.0;net7.0</TargetFrameworks>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe you could also remove the netcoreapp3.1(End of support: December 13, 2022) and net7.0(End of support: May 14, 2024) and add net8.0

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aight sounds good (does adding net8.0 do anything if everything else stays the same?)

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I'll do this in a separate commit

This comment was marked as outdated.

This comment was marked as outdated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aight sounds good (does adding net8.0 do anything if everything else stays the same?)

adding net8.0 won't change anything but I think it's a good idea to include the latest LTS version of .NET

MingweiSamuel pushed a commit that referenced this pull request Apr 4, 2024
Squashed commits:

- Fix example code in readme
- Add example for a custom API domain
- Remove unused config variable "apiRegionAsSubdomain"
- Removed proxy documentation
- Rename ApiURL variable to fit code style
- Add support for region as a header parameter, and more specific URL building
- Moved RegionConfig to Camille.RiotGames.Enums, and changed its values casing
- Remove generated license callout
- Correct variable in apiUrl description
- Clarify apiUrl description
- Move RegionHeaderKey to instead be RegionKey, and use it for the query parameter
- Use the new RegionKey variable
- Do not branch off of the URL contents
- Use RegionKey to build the URL without string checking
- Change naming region->route
- Simplify query param editing code (.NET is a mess)
Squashed commits:

- Fix example code in readme
- Add example for a custom API domain
- Remove unused config variable "apiRegionAsSubdomain"
- Removed proxy documentation
- Rename ApiURL variable to fit code style
- Add support for region as a header parameter, and more specific URL building
- Moved RegionConfig to Camille.RiotGames.Enums, and changed its values casing
- Remove generated license callout
- Correct variable in apiUrl description
- Clarify apiUrl description
- Move RegionHeaderKey to instead be RegionKey, and use it for the query parameter
- Use the new RegionKey variable
- Do not branch off of the URL contents
- Use RegionKey to build the URL without string checking
- Change naming region->route
- Simplify query param editing code (.NET is a mess)
@MingweiSamuel MingweiSamuel merged commit 47e4ddf into release/3.x.x Apr 4, 2024
2 checks passed
MingweiSamuel added a commit that referenced this pull request Apr 4, 2024
@MingweiSamuel MingweiSamuel deleted the moba branch April 4, 2024 19:15
MingweiSamuel added a commit that referenced this pull request Apr 4, 2024
Also removes stragling `netstandard1.1` references (#108)
MingweiSamuel added a commit that referenced this pull request Apr 4, 2024
Also removes stragling `netstandard1.1` references (#108)
MingweiSamuel added a commit that referenced this pull request Apr 4, 2024
Also removes stragling `netstandard1.1` references (#108)
MingweiSamuel added a commit that referenced this pull request Apr 4, 2024
Also removes stragling `netstandard1.1` references (#108)
MingweiSamuel added a commit that referenced this pull request Apr 4, 2024
Also removes stragling `netstandard1.1` references (#108)
MingweiSamuel added a commit that referenced this pull request Apr 4, 2024
Also removes stragling `netstandard1.1` references (#108)
@MingweiSamuel MingweiSamuel mentioned this pull request Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants