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

network-constants

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

network-constants - npm Package Compare versions

Comparing version 0.9.0 to 0.9.2

.travis.yml

6

bower.json
{
"name": "network-constants.js",
"version": "0.9.0",
"version": "0.9.2",
"description": "a bunch of network (mainly HTTP) constants for js programs (node + browser), AMD",

@@ -12,3 +12,5 @@ "keywords": [

"authors": [ "Offirmo <offirmo.net@gmail.com>" ],
"homepage": "https://github.com/Offirmo/network-constants.js"
"homepage": "https://github.com/Offirmo/network-constants.js",
"dependencies": {
}
}

@@ -23,6 +23,2 @@ // if node.js : use amdefine (add it with npm)

'header_fields': {
// TODO
},
// HTTP status codes

@@ -35,7 +31,9 @@ // http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

// 100 : informational
status_100_continue: 100,
status_100_continue : 100, // the server has received the request headers, and that the client should proceed to send the request body (in the case of a request for which a body needs to be sent)
status_102_processing : 102, // the server has received and is processing the request, but no response is available yet.[3] This prevents the client from timing out and assuming the request was lost.
// 200 : success
status_200_ok: 200,
status_201_created: 201,
status_200_ok: 200,
status_201_created: 201,
status_204_ok_no_content: 204,

@@ -63,5 +61,7 @@ // 300 redirection

100 : "Continue",
102 : "Processing",
200 : "OK",
201 : "Created",
204 : "No content",

@@ -81,11 +81,67 @@ 400 : "Bad Request",

507 : "Insufficient Storage"
},
// http://en.wikipedia.org/wiki/List_of_HTTP_header_fields
'request_headers' : {
'Accept': undefined, // Content-Types that are acceptable for the response Accept: text/plain Permanent
'Accept-Charset': undefined, // Character sets that are acceptable Accept-Charset: utf-8
'Accept-Encoding': undefined, // List of acceptable encodings. See HTTP compression. Accept-Encoding: gzip, deflate
'Accept-Language': undefined, // List of acceptable human languages for response Accept-Language: en-US
'Accept-Datetime': undefined, // Acceptable version in time Accept-Datetime: Thu, 31 May 2007 20:35:00 GMT Provisional
'Authorization': undefined, // Authentication credentials for HTTP authentication Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
'Cache-Control': undefined, // Used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain Cache-Control: no-cache Permanent
'Connection': undefined, // What type of connection the user-agent would prefer Connection: keep-alive Permanent
'Cookie': undefined, // an HTTP cookie previously sent by the server with Set-Cookie (below) Cookie: $Version=1; Skin=new; Permanent: standard
'Content-Length': undefined, // The length of the request body in octets (8-bit bytes) Content-Length: 348 Permanent
'Content-MD5': undefined, // A Base64-encoded binary MD5 sum of the content of the request body Content-MD5: Q2hlY2sgSW50ZWdyaXR5IQ== Permanent
'Content-Type': undefined, // The MIME type of the body of the request (used with POST and PUT requests) Content-Type: application/x-www-form-urlencoded Permanent
'Date': undefined, // The date and time that the message was sent Date: Tue, 15 Nov 1994 08:12:31 GMT Permanent
'Expect': undefined, // Indicates that particular server behaviors are required by the client Expect: 100-continue Permanent
'From': undefined, // The email address of the user making the request From: user@example.com Permanent
'Host': undefined, // The domain name of the server (for virtual hosting), and the TCP port number on which the server is listening. The port number may be omitted if the port is the standard port for the service requested.[8] Mandatory since HTTP/1.1. Although domain name are specified as case-insensitive,[9][10] it is not specified whether the contents of the Host field should be interpreted in a case-insensitive manner[11] and in practice some implementations of virtual hosting interpret the contents of the Host field in a case-sensitive manner.[citation needed] Host: en.wikipedia.org:80
'If-Match': undefined, // Only perform the action if the client supplied entity matches the same entity on the server. This is mainly for methods like PUT to only update a resource if it has not been modified since the user last updated it. If-Match: "737060cd8c284d8af7ad3082f209582d" Permanent
'If-Modified-Since': undefined, // Allows a 304 Not Modified to be returned if content is unchanged If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT Permanent
'If-None-Match': undefined, // Allows a 304 Not Modified to be returned if content is unchanged, see HTTP ETag If-None-Match: "737060cd8c284d8af7ad3082f209582d" Permanent
'If-Range': undefined, // If the entity is unchanged, send me the part(s) that I am missing; otherwise, send me the entire new entity If-Range: "737060cd8c284d8af7ad3082f209582d" Permanent
'If-Unmodified-Since': undefined, // Only send the response if the entity has not been modified since a specific time. If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT Permanent
'Max-Forwards': undefined, // Limit the number of times the message can be forwarded through proxies or gateways. Max-Forwards: 10 Permanent
'Origin': undefined, // Initiates a request for cross-origin resource sharing (asks server for an 'Access-Control-Allow-Origin' response header) . Origin: http://www.example-social-network.com Permanent: standard
'Pragma': undefined, // Implementation-specific headers that may have various effects anywhere along the request-response chain. Pragma: no-cache Permanent
'Proxy-Authorization': undefined, // Authorization credentials for connecting to a proxy. Proxy-Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== Permanent
'Range': undefined, // Request only part of an entity. Bytes are numbered from 0. Range: bytes=500-999 Permanent
'Referer': undefined, // [sic] This is the address of the previous web page from which a link to the currently requested page was followed. (The word “referrer” is misspelled in the RFC as well as in most implementations.) Referer: http://en.wikipedia.org/wiki/Main_Page Permanent
'TE': undefined, // The transfer encodings the user agent is willing to accept: the same values as for the response header Transfer-Encoding can be used, plus the "trailers" value (related to the "chunked" transfer method) to notify the server it expects to receive additional headers (the trailers) after the last, zero-sized, chunk. TE: trailers, deflate Permanent
'Upgrade': undefined, // Ask the server to upgrade to another protocol. Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11 Permanent
'User-Agent': undefined, // The user agent string of the user agent User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20100101 Firefox/21.0 Permanent
'Via': undefined, // Informs the server of proxies through which the request was sent. Via: 1.0 fred, 1.1 example.com (Apache/1.1) Permanent
'Warning': undefined // A general warning about possible problems with the entity body.
},
'content_types': {
'application' : {
'json' : 'application/json',
'text' : 'application/text'
},
'audio' : {},
'example' : {},
'image' : {},
'message' : {},
'model' : {},
'multipart' : {},
'text' : {
'plain' : 'text/plain'
},
'video' : {},
'vnd' : {}
}
};
Object.freeze(http_constants);
Object.freeze(http_constants.methods);
Object.freeze(http_constants.header_fields);
Object.freeze(http_constants.status_codes);
Object.freeze(http_constants.status_messages);
Object.freeze(http_constants.request_headers);
return http_constants;
}); // requirejs module
{
"name": "network-constants",
"version": "0.9.0",
"version": "0.9.2",
"description": "a bunch of network (mainly HTTP) constants for js programs (node + browser), AMD",

@@ -14,2 +14,3 @@ "keywords": "network, constants, http, protocol, browser, server",

"dependencies": {
"amdefine": "~0.1"
},

@@ -23,4 +24,4 @@ "engines": {

"scripts": {
"test": "cd test_runner && npm install && make"
"test": "npm install && cd test_runner && make"
}
}
network-constants.js
====================
[![Build Status](https://travis-ci.org/Offirmo/network-constants.js.png?branch=master)](https://travis-ci.org/Offirmo/network-constants.js)
[![NPM version](https://badge.fury.io/js/network-constants.png)](http://badge.fury.io/js/network-constants)
[![Bower version](https://badge.fury.io/bo/network-constants.js.png)](http://badge.fury.io/bo/network-constants.js)
[![status](https://sourcegraph.com/api/repos/github.com/Offirmo/network-constants.js/badges/status.png)](https://sourcegraph.com/github.com/Offirmo/network-constants.js)
[![Total views](https://sourcegraph.com/api/repos/github.com/Offirmo/network-constants.js/counters/views.png)](https://sourcegraph.com/github.com/Offirmo/network-constants.js)
Introduction

@@ -35,3 +41,8 @@ ------------

Installation
------------
Bower : `bower install network-constants.js`
Npm : `npm install network-constants`
Unit tests

@@ -38,0 +49,0 @@ ----------

{
"name": "network-constants-test-runner",
"version": "1.0.0",
"version": "99.99.99",
"dependencies": {
"chai": "latest",

@@ -7,0 +6,0 @@ "mocha": "latest",

{
"name": "network-constants-test-runner",
"description": "node test runner for network-constants.js",
"version": "1.0.0",
"description": "node test runner for network-constants",
"version": "99.99.99",
"private": true,
"dependencies": {
"network-constants.js": "latest",
"amdefine": "latest",

@@ -11,0 +8,0 @@ "chai": "latest",

"use strict";
//console.log("hello from tests init !");
// this files does nothing and just serve as an entry point for node unit tests

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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