Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Header values with whitespace are considered invalid. #42

Open
xCynDev opened this issue Dec 10, 2024 · 2 comments
Open

Header values with whitespace are considered invalid. #42

xCynDev opened this issue Dec 10, 2024 · 2 comments

Comments

@xCynDev
Copy link

xCynDev commented Dec 10, 2024

This prevents the use of Bearer tokens for authentication. The following throws an error:

myWebsocket:setHeader("Authorization", token)

Where token is:

Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI1eVNXSnFrNmVpQWdaemFELVFOa2t0dmdIOGN2V2lqeHFfTkxiVWRjVWh3In0.eyJleHAiOjE3MzM3OTE1OTgsImlhdCI6MTczMzc5MTI5OCwianRpIjoiMjAwZTk3YTctNTQxNi00NTFiLTg2ZmQtY2NlNTlhYWFhMTI4IiwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdDo3MDcwL3JlYWxtcy9zeW5lcmd5IiwiYXVkIjoic3luZXJneS1iYWNrZW5kIiwic3ViIjoiMDRjMTM0ZTEtZTEwNC00MzU1LTg1ZmUtMDU5MTQ0ZGZiMjg5IiwidHlwIjoiQmVhcmVyIiwiYXpwIjoic3luZXJneS1kZXYtc2VydmVyIiwiYWNyIjoiMSIsImFsbG93ZWQtb3JpZ2lucyI6WyIvKiJdLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsidHJ1c3RlZF9nYW1lX3NlcnZlciIsImRlZmF1bHQtcm9sZXMtc3luZXJneSIsInN5bmVyZ3lfYWNjZXNzIl19LCJzY29wZSI6InN5bmVyZ3kiLCJjbGllbnRIb3N0IjoiMTcyLjE4LjAuMSIsImNsaWVudEFkZHJlc3MiOiIxNzIuMTguMC4xIiwiY2xpZW50X2lkIjoic3luZXJneS1kZXYtc2VydmVyIn0.dtMMRk-QiM3_HXldWYo2EhgxQKn7GsWZFBG03_P3smcuh0a8V3HjH5k6bH0UfGi6zdoCdsihtrx5B_fI4OiasFO3aD-dWqTuyJowcOV0WKO4X3rvFJw3VQ-7lo3YU_VF8-wPxOEU4EtUn01gVwXL-Yb1QLYUG1vy21flMY3p7q4Y5lXV3O28pGhi-voFtdiII6hWXVzOLhIce2zP4-O_KIHIuimgM5SH3ftifwD2qo5VRMKKLcjFvqrQwzlQbMS9NRAPAByJXK5zBnUp3WJ2JyXJrq5SjCdOOkh_E09VZKze3RTANIb69audXq7e1kk9nCMxfqmd9WE7p6lcry2z7A

Error:

[synergy-core] addons/synergy-core/lua/synergy-modules/api/websockets/sv_websockets.lua:46: Invalid header name or value
  1. unknown - [C]:-1
@xCynDev
Copy link
Author

xCynDev commented Dec 10, 2024

For some reason, after re-building the lib from scratch instead of using your releases, it just works? Dunno if that helps but uh, pretty weird.

@xCynDev
Copy link
Author

xCynDev commented Dec 10, 2024

As discussed on the Discord - it is probably due to newer versions of VS and its compiler that seem to have fixed the issue. Tested with 32 bit and 64 bit binaries on Windows, the issue is gone after a simple recompile. Re-compiling the binaries and releasing them again should solve the issues permanently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant