Skip to content

Commit ab826c3

Browse files
committed
Revert "allow wss:// scheme, preserve uri query parameters"
This reverts commit 9ee1543.
1 parent 9ee1543 commit ab826c3

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/GraphQL.Client/GraphQLHttpClient.cs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ public GraphQLHttpClient(GraphQLHttpClientOptions options, IGraphQLWebsocketJson
6666
HttpClient.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue(GetType().Assembly.GetName().Name, GetType().Assembly.GetName().Version.ToString()));
6767

6868
_lazyHttpWebSocket = new Lazy<GraphQLHttpWebSocket>(() => new GraphQLHttpWebSocket(GetWebSocketUri(), this));
69-
if ((Options.EndPoint?.Scheme == "wss") || (Options.EndPoint?.Scheme == "ws"))
70-
{
71-
Options.UseWebSocketForQueriesAndMutations = true;
72-
}
7369
}
7470

7571
#endregion
@@ -159,12 +155,8 @@ private async Task<GraphQLHttpResponse<TResponse>> SendHttpRequestAsync<TRespons
159155

160156
private Uri GetWebSocketUri()
161157
{
162-
string webSocketSchema = Options.EndPoint.Scheme == "https"
163-
? "wss"
164-
: Options.EndPoint.Scheme == "http"
165-
? "ws"
166-
: Options.EndPoint.Scheme;
167-
return new Uri($"{webSocketSchema}://{Options.EndPoint.Host}:{Options.EndPoint.Port}{Options.EndPoint.AbsolutePath}{Options.EndPoint.Query}");
158+
string webSocketSchema = Options.EndPoint.Scheme == "https" ? "wss" : "ws";
159+
return new Uri($"{webSocketSchema}://{Options.EndPoint.Host}:{Options.EndPoint.Port}{Options.EndPoint.AbsolutePath}");
168160
}
169161

170162
#endregion

0 commit comments

Comments
 (0)