iLya2IK / wchttpserver

HTTP/2+HTTP/1.1+WebSocket server written with Lazarus (Free Pascal)
GNU Lesser General Public License v2.1
57 stars 18 forks source link

unit httpprotocol, add some headers #7

Closed nomorelogic closed 3 years ago

nomorelogic commented 3 years ago

Hi coud you please add following headers in THeader and HTTPHeaderNames? Thanks

Access-Control-Allow-Origin Access-Control-Allow-Credentials Access-Control-Allow-Methods Access-Control-Allow-Headers

iLya2IK commented 3 years ago

Of course, I added the necessary headers, but not in the httppprotocol unit, but in the http2http1conv unit. I cannot modify the httppprotocol as it is part of a different package being developed by a different group of programmers. I recommend paying attention to the GetCustomHeader and SetCustomHeader methods for TRequest and TResponse. This way you can write or receive any non-standard header (not yet included in httppprotocol unit). But these methods work fully only for http/1.1. For http/2 all new headers must be defined in the http2http1conv unit.

nomorelogic commented 3 years ago

Thank you for adding headers and for explanation. Really a great project.