FredyH / GWSockets

WebSockets for GLua
MIT License
87 stars 7 forks source link

Allow extra characters in header values #23

Closed viral32111 closed 4 years ago

viral32111 commented 4 years ago

Summary

This change allows for a few extra characters which are very common across the current web to be used in the header field values for the websocket handshake/upgrade request.

Reasoning

Notes

  1. Instead of modifying headerRegex, I split the pattern for the header field name and field value into two patterns (the same as cookie) for finer control, since all the characters I've added to the header field value pattern should not be used in header field names.
  2. There's a few characters in the header field name pattern which shouldn't be there (such as ~, |, *, etc.), but I've decided to leave them for backwards compatibility (in case someone is using them, for whatever reason).