Repository navigation
Closed
Labels
🌐 area: http-pipelineHttpClient, IHttpClientFactory, DelegatingHandlers, lifetime🐛 bug🔴 priority: highImportant: correctness, build, or AOT breakage on common paths
Description
Describe the bug
It's impossible to use a CultureInfo type as a parameter for clients. I get an infinite loop and a stack overflow.
public interface IClient
{
[Get("/testCulture")]
Task<string> TestCulture([Query] CultureInfo culture);
}
Exception
Stack overflow.
at System.RuntimeMethodHandle.InvokeMethod(System.Object, System.Span`1<System.Object> ByRef, System.Signature, Boolean, Boolean)
at System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
at System.Reflection.RuntimePropertyInfo.GetValue(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
at System.Reflection.RuntimePropertyInfo.GetValue(System.Object, System.Object[])
at Refit.RequestBuilderImplementation.BuildQueryMap(System.Object, System.String, Refit.RestMethodParameterInfo)
at Refit.RequestBuilderImplementation.BuildQueryMap(System.Object, System.String, Refit.RestMethodParameterInfo)
at Refit.RequestBuilderImplementation.BuildQueryMap(System.Object, System.String, Refit.RestMethodParameterInfo)
at Refit.RequestBuilderImplementation.BuildQueryMap(System.Object, System.String, Refit.RestMethodParameterInfo)
at Refit.RequestBuilderImplementation.BuildQueryMap(System.Object, System.String, Refit.RestMethodParameterInfo)
...................................................
at Refit.RequestBuilderImplementation.BuildQueryMap(System.Object, System.String, Refit.RestMethodParameterInfo)
at Refit.RequestBuilderImplementation.BuildQueryMap(System.Object, System.String, Refit.RestMethodParameterInfo)
at Refit.RequestBuilderImplementation.BuildQueryMap(System.Object, System.String, Refit.RestMethodParameterInfo)
at Refit.RequestBuilderImplementation.BuildQueryMap(System.Object, System.String, Refit.RestMethodParameterInfo)
at Refit.RequestBuilderImplementation+<>c__DisplayClass18_0.<BuildRequestFactoryForMethod>b__0(System.Object[])
at Refit.RequestBuilderImplementation+<>c__DisplayClass14_0`2+<<BuildCancellableTaskFuncForMethod>b__0>d[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Refit.RequestBuilderImplementation+<>c__DisplayClass14_0`2+<<BuildCancellableTaskFuncForMethod>b__0>d[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], Refit, Version=6.3.0.0, Culture=neutral, PublicKeyToken=2f9b1262776509f5]](<<BuildCancellableTaskFuncForMethod>b__0>d<System.__Canon,System.__Canon> ByRef)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Start[[Refit.RequestBuilderImplementation+<>c__DisplayClass14_0`2+<<BuildCancellableTaskFuncForMethod>b__0>d[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], Refit, Version=6.3.0.0, Culture=neutral, PublicKeyToken=2f9b1262776509f5]](<<BuildCancellableTaskFuncForMethod>b__0>d<System.__Canon,System.__Canon> ByRef)
at Refit.RequestBuilderImplementation+<>c__DisplayClass14_0`2[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].<BuildCancellableTaskFuncForMethod>b__0(System.Net.Http.HttpClient, System.Threading.CancellationToken, System.Object[])
at Refit.RequestBuilderImplementation+<>c__DisplayClass22_0`2[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].<BuildTaskFuncForMethod>b__0(System.Net.Http.HttpClient, System.Object[])
at System.RuntimeMethodHandle.InvokeMethod(System.Object, System.Span`1<System.Object> ByRef, System.Signature, Boolean, Boolean)
at System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
at System.Delegate.DynamicInvokeImpl(System.Object[])
at System.Delegate.DynamicInvoke(System.Object[])
at Refit.RequestBuilderImplementation+<>c__DisplayClass12_1.<BuildRestResultFuncForMethod>b__1(System.Net.Http.HttpClient, System.Object[])
at Refit.Implementation.Generated+RefitClientIClient.global::Refit.Client.IClient.TestCulture(System.Globalization.CultureInfo)
at Refit.Client.Program.Main(System.String[])
Expected behavior
If it's impossible to use a CultureInfo as a parameter then it would be better to see an exception.
Environment
- OS: Win11
- Version: 6.3.2
Metadata
Metadata
Assignees
Labels
🌐 area: http-pipelineHttpClient, IHttpClientFactory, DelegatingHandlers, lifetime🐛 bug🔴 priority: highImportant: correctness, build, or AOT breakage on common paths
Activity
fix: correct URL and query string building edge cases (reactiveui#2137)
github-actions commentedon Jul 2, 2026
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.