Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

http-constants-ts

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-constants-ts

Http Constants for mime-types, headers, tracking-statuses, methods, content-encodings, csp, response codes and cache-control instructions

  • 1.0.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
505
decreased by-21.71%
Maintainers
1
Weekly downloads
 
Created
Source

Http constants for mime-types, headers, tracking-statuses, methods, content-encodings, csp, response codes and cache-control instructions

Provides standard and common non-standard http headers, mime-types, methods, content codings, response statuses, CSP directives and sources, cache-control instructions and tracking statuses.

All headers are capitalized, hence Access-Control-Request-Method All mime-types are lowercase, hence video/mpeg All content codings are lowercase, hence deflate All methods are uppercase, hence POST All response codes are integer numbers, hence 404 All Cache-Control instructions are lowercase, hence min-fresh All CSP directives and sources are lowercase, hence unsafe-eval

Key names constructed from uppercase values, -, + and . substituted with _, hence

Headers.STRICT_TRANSPORT_SECURITY //Strict-Transport-Security
MimeTypes.Application.XOP_XML     //application/xop+xml
MimeTypes.Model.X3D_VRML          //model/x3d+vrml
ContentEncodings.X_GZIP           //x-gzip
MimeTypes.Image.VND_WAP_WBMP      //image/vnd.wap.wbmp
ResponseCodes.I_AM_A_TEAPOT       //418
CacheControls.MAX_AGE             //max-age
CSPS.UNSAFE_EVAL                  //unsafe-eval

Usage

Install local

npm install http-constants-ts --save

Available at the moment

  • Headers - headers
  • TrackingStatuses - tracking statuses
  • Methods - http methods
  • ContentEncodings - http content coding registry
  • ResponseCodes - response codes
  • CacheControls - Cache-Control instructions
  • CSPD - CSP directives
  • CSPS - some CSP source values
  • MimeTypes - yes, mime types, fair and square

Dependencies

No additional dependencies for production.

Contribute

Missing constants? Issues? Please feel free to extend / create a pull request.

Best regards iDschepe

Credits

Thanks to / forked from https://bitbucket.org/sypachev_s_s/http-headers-js

Keywords

FAQs

Package last updated on 25 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc