Add wspath option - #3
Open
AbdoPrDZ wants to merge 6 commits into
Open
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new wsPath option for custom WebSocket path configuration, updates usage docs, and bumps the package version.
- Bumps version from 0.0.5 to 0.0.6
- Adds
wsPathfield with default/appand uses it in URL path construction - Updates README with
wsPathin example and options table, fixes a typo
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pubspec.yaml | Bump version to 0.0.6 |
| lib/src/options.dart | Add wsPath option, default value, and apply in path |
| README.md | Include wsPath in example and options table; fix typo |
Comments suppressed due to low confidence (2)
README.md:168
- The README states the default for
encryptedisfalse, but the code default istrue. Please align the documentation with the implementation or adjust the default in code.
| `encrypted` | `bool` | A flag indicating whether to enable encrypted connection. Default is `false`. |
lib/src/options.dart:26
- Add unit tests for the new
wsPathoption to verify that WebSocket URLs are constructed correctly under different path values.
final String wsPath;
| if (hostUri?.query.isNotEmpty == true) ...hostUri!.queryParameters, | ||
| }, | ||
| path: '/app/$key', | ||
| path: '${wsPath}/${key}', |
There was a problem hiding this comment.
[nitpick] Consider normalizing wsPath (e.g., trimming a trailing slash) before concatenation to prevent duplicate or missing slashes in the final URL.
Suggested change
| path: '${wsPath}/${key}', | |
| path: '${wsPath.replaceAll(RegExp(r'/+$'), '')}/${key}', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.