用工小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.6 KiB

6 months ago
  1. digest-header
  2. =======
  3. [![Node.js CI](https://github.com/node-modules/digest-header/actions/workflows/nodejs.yml/badge.svg)](https://github.com/node-modules/digest-header/actions/workflows/nodejs.yml)
  4. Digest access authentication header helper.
  5. ## Install
  6. ```bash
  7. npm install digest-header
  8. ```
  9. ## Usage
  10. ```js
  11. var digest = require('digest-header');
  12. var method = 'GET';
  13. var uri = '/admin';
  14. var wwwAuthenticate = res.headers['WWW-Authenticate'];
  15. var userpass = 'user:pass';
  16. var auth = digest(method, uri, wwwAuthenticate, userpass);
  17. ```
  18. ## License
  19. (The MIT License)
  20. Copyright (c) 2014 fengmk2 <fengmk2@gmail.com> and other contributors
  21. Permission is hereby granted, free of charge, to any person obtaining
  22. a copy of this software and associated documentation files (the
  23. 'Software'), to deal in the Software without restriction, including
  24. without limitation the rights to use, copy, modify, merge, publish,
  25. distribute, sublicense, and/or sell copies of the Software, and to
  26. permit persons to whom the Software is furnished to do so, subject to
  27. the following conditions:
  28. The above copyright notice and this permission notice shall be
  29. included in all copies or substantial portions of the Software.
  30. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
  31. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  32. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  33. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  34. CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  35. TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  36. SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.