Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ayon_api/server_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
NOT_SET,
get_media_mime_type,
SortOrder,
get_machine_name,
)

if typing.TYPE_CHECKING:
Expand Down Expand Up @@ -1256,7 +1257,7 @@ def get_headers(
headers = {
"Content-Type": content_type,
"x-ayon-platform": platform.system().lower(),
"x-ayon-hostname": platform.node(),
"x-ayon-hostname": get_machine_name(),
"referer": self.get_base_url(),
}
if self._site_id is not None:
Expand Down
11 changes: 11 additions & 0 deletions ayon_api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,17 @@ def get_default_settings_variant() -> str:
return os.environ.get(DEFAULT_VARIANT_ENV_KEY) or "production"


def get_machine_name() -> str:
"""Get machine name.

Returns:
str: Machine name.

"""
return platform.node()
Copy link
Contributor

Choose a reason for hiding this comment

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

Uh... oopsie?

Copy link
Member Author

Choose a reason for hiding this comment

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

For future reference, fixed with #252

return unidecode.unidecode(platform.node())


def get_default_site_id() -> Optional[str]:
"""Site id used for server connection.

Expand Down