Marketplace móvil para negocios locales mexicanos. Estructura inicial: - apps/backend (NestJS API) - apps/frontend (React Web) - apps/mobile (Expo/React Native) - apps/mcp-server (Claude MCP Server) - apps/whatsapp-service (WhatsApp Business API) - database/ (PostgreSQL DDL) - docs/ (Documentación) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
29 lines
824 B
JavaScript
29 lines
824 B
JavaScript
var auth_hdr = require('../lib/auth_header')
|
|
|
|
|
|
describe('Parsing Auth Header field-value', function() {
|
|
|
|
it('Should handle single space separated values', function() {
|
|
var res = auth_hdr.parse("SCHEME VALUE");
|
|
expect(res).to.deep.equal({scheme: "SCHEME", value: "VALUE"});
|
|
});
|
|
|
|
|
|
it('Should handle CRLF separator', function() {
|
|
var res = auth_hdr.parse("SCHEME\nVALUE");
|
|
expect(res).to.deep.equal({scheme: "SCHEME", value: "VALUE"});
|
|
});
|
|
|
|
|
|
it('Should handle malformed authentication headers with no scheme', function() {
|
|
var res = auth_hdr.parse("malformed");
|
|
expect(res).to.not.be.ok;
|
|
});
|
|
|
|
|
|
it('Should return null when the auth header is not a string', function() {
|
|
var res = auth_hdr.parse({});
|
|
expect(res).to.be.null;
|
|
});
|
|
});
|