Simple_httpd.HeadersSourceModule to handle request and response headers
Headers are metadata associated with a request or response. This module provide the necessary function to read and modify headers
A module defining all the legal header names, generated from the csv at iana. last update: 29.06.2023. Other headers are ignored!
type header = Simple_httpd__Headers_.header = | X_Real_IP| X_Forwarded_For| X_CSRF_Token| Filename_Multipart| CF_Connecting_IP| A_IM| Accept| Accept_Additions| Accept_CH| Accept_Charset| Accept_Datetime| Accept_Encoding| Accept_Features| Accept_Language| Accept_Patch| Accept_Post| Accept_Ranges| Accept_Signature| Access_Control_Allow_Credentials| Access_Control_Allow_Headers| Access_Control_Allow_Methods| Access_Control_Allow_Origin| Access_Control_Expose_Headers| Access_Control_Max_Age| Access_Control_Request_Headers| Access_Control_Request_Method| Age| Allow| ALPN| Alt_Svc| Alt_Used| Alternates| AMP_Cache_Transform| Apply_To_Redirect_Ref| Authentication_Control| Authentication_Info| Authorization| Available_Dictionary| C_PEP_Info| Cache_Control| Cache_Status| Cal_Managed_ID| CalDAV_Timezones| Capsule_Protocol| CDN_Cache_Control| CDN_Loop| Cert_Not_After| Cert_Not_Before| Clear_Site_Data| Client_Cert| Client_Cert_Chain| Close| CMCD_Object| CMCD_Request| CMCD_Session| CMCD_Status| CMSD_Dynamic| CMSD_Static| Concealed_Auth_Export| Configuration_Context| Connection| Content_Digest| Content_Disposition| Content_Encoding| Content_ID| Content_Language| Content_Length| Content_Location| Content_Range| Content_Security_Policy| Content_Security_Policy_Report_Only| Content_Type| Cookie| Cross_Origin_Embedder_Policy| Cross_Origin_Embedder_Policy_Report_Only| Cross_Origin_Opener_Policy| Cross_Origin_Opener_Policy_Report_Only| Cross_Origin_Resource_Policy| CTA_Common_Access_Token| DASL| Date| DAV| Delta_Base| Deprecation| Depth| Destination| Differential_ID| Dictionary_ID| DPoP| DPoP_Nonce| Early_Data| EDIINT_Features| ETag| Expect| Expect_CT| Expires| Forwarded| From| Hobareg| Host| If| If_Match| If_Modified_Since| If_None_Match| If_Range| If_Schedule_Tag_Match| If_Unmodified_Since| IM| Include_Referred_Token_Binding_ID| Isolation| Keep_Alive| Label| Last_Event_ID| Last_Modified| Link| Link_Template| Location| Lock_Token| Max_Forwards| Memento_Datetime| Meter| MIME_Version| Negotiate| NEL| OData_EntityId| OData_Isolation| OData_MaxVersion| OData_Version| Optional_WWW_Authenticate| Ordering_Type| Origin| Origin_Agent_Cluster| OSCORE| OSLC_Core_Version| Overwrite| Permissions_Policy| Ping_From| Ping_To| Position| Pragma| Prefer| Preference_Applied| Priority| Protocol_Info| Protocol_Query| Proxy_Authenticate| Proxy_Authentication_Info| Proxy_Authorization| Proxy_Status| Public_Key_Pins| Public_Key_Pins_Report_Only| Range| Redirect_Ref| Referer| Referrer_Policy| Refresh| Repeatability_Client_ID| Repeatability_First_Sent| Repeatability_Request_ID| Repeatability_Result| Replay_Nonce| Reporting_Endpoints| Repr_Digest| Retry_After| Schedule_Reply| Schedule_Tag| Sec_GPC| Sec_Purpose| Sec_Token_Binding| Sec_WebSocket_Accept| Sec_WebSocket_Extensions| Sec_WebSocket_Key| Sec_WebSocket_Protocol| Sec_WebSocket_Version| Server| Server_Timing| Set_Cookie| Signature| Signature_Input| SLUG| SoapAction| Status_URI| Strict_Transport_Security| Sunset| Surrogate_Capability| Surrogate_Control| TCN| TE| Timeout| Timing_Allow_Origin| Topic| Traceparent| Tracestate| Trailer| Transfer_Encoding| TTL| Upgrade| Urgency| Use_As_Dictionary| User_Agent| Variant_Vary| Vary| Via| Want_Content_Digest| Want_Repr_Digest| WWW_Authenticate| X_Content_Type_Options| X_Frame_Optionsval to_string : header -> stringThe header files of a request or response.
Neither the key nor the value can contain '\r' or '\n'. See https://tools.ietf.org/html/rfc7230#section-3.2
get k headers looks for the header field with key k.
get_exn k headers same as above but raise Not_found if the headers is not present.
set k v headers sets the key k to value v. It erases any previous entry for k
Pretty print the headers.