Skip to content

Commit

Permalink
fix: remove user-agent header
Browse files Browse the repository at this point in the history
  • Loading branch information
nickpetrovic committed Jan 10, 2025
1 parent 1d9cace commit 8219155
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions sdk/src/beta9/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import traceback
from abc import ABC, abstractmethod
from contextlib import contextmanager
from importlib import metadata
from typing import Any, Callable, Generator, List, NewType, Optional, Sequence, Tuple, cast

import grpc
Expand Down Expand Up @@ -36,11 +35,6 @@ def channel_reconnect_event(connect_status: grpc.ChannelConnectivity) -> None:
terminal.warn("Connection lost, reconnecting...")


def get_user_agent() -> Optional[str]:
if p := __package__:
return f"{p}/{metadata.version(p)}"


class Channel(InterceptorChannel):
def __init__(
self,
Expand All @@ -56,10 +50,6 @@ def __init__(
if options is None:
options = []

options = [opt for opt in options if "grpc.secondary_user_agent" not in opt[0]]
if ua := get_user_agent():
options.append(("grpc.secondary_user_agent", ua))

if credentials is not None:
channel = grpc.secure_channel(addr, credentials)
elif addr.endswith("443"):
Expand Down

0 comments on commit 8219155

Please sign in to comment.