Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Hostname with api in name broken forwebsocket_call  #246

Closed
@foklepoint

Description

@foklepoint

Currently websocket_call does some hackery to generate the websocket URL:

    # switch protocols from http to websocket
    url = url.replace('http://', 'ws://')
    url = url.replace('https://', 'wss://')

    # patch extra /
    url = url.replace('//api', '/api')

Websocket calls are broken when the URL includes the string 'api' in the hostname. For example:api.k8s.staging.mydomain.com will result in the following error:

kubernetes.client.rest.ApiException: (0)
Reason: hostname is invalid

A good solution would be to have proper URL parsing in place and replacing paths, rather than working off a pure string

Metadata

Metadata

Assignees

No one assigned

    Labels

    help-neededkind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions