Skip to content

Conversation

@WofWca
Copy link

@WofWca WofWca commented Nov 16, 2024

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Go Version Update
  • Dependency Update

Description

The purpose of this change is to set this behavior in stone, so that, for example, introducing "follow redirects" by default would be a breaking change. The WebSocket spec actually allows the client to follow redirects:

the server might redirect the client using a 3xx status code (but clients are not required to follow them)

I think this library should be explicit about whether it does this.

I feel like the existing "...so that callers can handle redirects, authentication, etcetera" is not worded strongly enough.

Background: I'm working on an application that makes connections to arbitrary addresses, so a target WebSocket server might be malicious. Thus I want to limit the scope of what a malicious server can do. For example, ensure that it's not gonna redirect the client to a private address, or to a DDoS target.

Related Tickets & Documents

Added/updated tests?

  • Yes
  • No, and this is why: this is purely a documentation change
  • I need help with writing tests

Run verifications and test

  • make verify is passing
  • make test is passing
The purpose of this change is to set this behavior in stone, so that, for example, introducing "follow redirects" by default would be a breaking change. The [WebSocket spec](https://www.rfc-editor.org/rfc/rfc6455) actually allows the client to follow redirects: > the server might redirect the client using a 3xx status code (but clients are not required to follow them) I think this library should be explicit about whether it does this. I feel like the existing "...so that callers can handle redirects, authentication, etcetera" is not worded strongly enough. Signed-off-by: WofWca <wofwca@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 participant