Giter Club home page Giter Club logo

Comments (3)

dougwilson avatar dougwilson commented on August 15, 2024

Cool, I'll get them added :) but it's unlikely to fix your issue, as by default the array we export comes from Node.js core, so running this module on Node.js still won't pick up any new methods I add here.

from methods.

dougwilson avatar dougwilson commented on August 15, 2024

In other words, if the following command does not list the methods you need, you need to file this issue with Node.js:

node -pe "require('http').METHODS"

from methods.

dougwilson avatar dougwilson commented on August 15, 2024

Looks like there is nothing for us to do, because require('http').METHODS doesn't include those two methods, even in the latest version of io.js; you'll notice in our source, all we do is return a lower-cased version of this array:

  module.exports = http.METHODS.map(function(method){
    return method.toLowerCase();
  });

I verified the latest version of io.js does not include those methods, so there is nothing we can do:

$ iojs -pe 'require("http").METHODS'
[ 'CHECKOUT',
  'CONNECT',
  'COPY',
  'DELETE',
  'GET',
  'HEAD',
  'LOCK',
  'M-SEARCH',
  'MERGE',
  'MKACTIVITY',
  'MKCALENDAR',
  'MKCOL',
  'MOVE',
  'NOTIFY',
  'OPTIONS',
  'PATCH',
  'POST',
  'PROPFIND',
  'PROPPATCH',
  'PURGE',
  'PUT',
  'REPORT',
  'SEARCH',
  'SUBSCRIBE',
  'TRACE',
  'UNLOCK',
  'UNSUBSCRIBE' ]

$ iojs -v
v2.4.0

The reason why we're not going to just add it is two-fold:

  1. This module currently only exists to provide a shim for require('http').METHODS in browser environments, thus at most, our list will be the same as the latest version of Node.js/io.js.
  2. The http server within Node.js/io.js will only allow methods through that appear in their METHODS array, so simply getting that method added to the browser-only array in this module won't help you use those methods in koa anyway.

from methods.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.