Currently, the server reads all files in a given directory prior to opening the port, in _start_server. It then creates a bound endpoint for each file there. This is good for performance, if this was a production server, but in case of file changes (file added, removed, renamed), changes will not be reflected, and it will lead to unexpected behavior for users.
Potential mitigations, in my preferred order:
have the server accept a single method; allow the implementation to remain entirely in userland. then, in userland, do point 2 below.
have the server accept a string match instead of a string for endpoints. If a string contains ? or *, match it instead of using has(). Potentially also accept regexes (or only regexes?). That means the lookup becomes O(n) instead of O(1) of course.
watch the directory for changes, refresh file list on change. Caveats: don't know how easy that is in Godot. Watching files in a cross platform way is usually tricky
Currently, the server reads all files in a given directory prior to opening the port, in `_start_server`. It then creates a bound endpoint for each file there. This is good for performance, if this was a production server, but in case of file changes (file added, removed, renamed), changes will not be reflected, and it will lead to unexpected behavior for users.
Potential mitigations, in my preferred order:
1. have the server accept a single method; allow the implementation to remain entirely in userland. then, in userland, do point 2 below.
2. have the server accept a string match instead of a string for endpoints. If a string contains `?` or `*`, match it instead of using `has()`. Potentially also accept regexes (or only regexes?). That means the lookup becomes O(n) instead of O(1) of course.
3. watch the directory for changes, refresh file list on change. Caveats: don't know how easy that is in Godot. Watching files in a cross platform way is usually tricky
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Currently, the server reads all files in a given directory prior to opening the port, in
_start_server. It then creates a bound endpoint for each file there. This is good for performance, if this was a production server, but in case of file changes (file added, removed, renamed), changes will not be reflected, and it will lead to unexpected behavior for users.Potential mitigations, in my preferred order:
?or*, match it instead of usinghas(). Potentially also accept regexes (or only regexes?). That means the lookup becomes O(n) instead of O(1) of course.closed by #9