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

@fastly/expressly

Package Overview
Dependencies
Maintainers
41
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fastly/expressly - npm Package Compare versions

Comparing version 1.0.0--canary.6.2595789627.0 to 1.0.0--canary.7.2690874917.0

dist/lib/routing/response/headers.d.ts

2

dist/lib/routing/request/index.js
import { addCommonMethods } from "../common";
import { CookieMap } from "./cookie-map";
// Will extend Request correctly after https://github.com/fastly/js-compute-runtime/pull/116 is merged
// See: https://github.com/fastly/js-compute-runtime/issues/113
class ERequestBase extends Request {

@@ -6,0 +4,0 @@ constructor(config, event) {

/// <reference types="@fastly/js-compute" />
import { SurrogateKeys } from "./surrogate-keys";
import { EHeaders } from "./headers";
import { CookieOptions, EConfig } from "..";
declare class EResponseBase {
private config;
headers: Headers;
headers: EHeaders;
status: number;

@@ -8,0 +9,0 @@ body: BodyInit;

@@ -5,8 +5,7 @@ import cookie from "cookie";

import { SurrogateKeys } from "./surrogate-keys";
// TODO: extends Response
// See: https://github.com/fastly/js-compute-runtime/issues/113
import { EHeaders } from "./headers";
class EResponseBase {
constructor(config) {
this.config = config;
this.headers = new Headers();
this.headers = new EHeaders();
this.status = 0;

@@ -16,3 +15,2 @@ this.body = null;

this.surrogateKeys = new SurrogateKeys(this.headers);
// super();
}

@@ -32,3 +30,3 @@ // Header helpers.

return;
this.headers.append("Set-Cookie", cookie.serialize(key, "", { ...options, expires: "Thu, 01 Jan 1970 00:00:00 GMT" }));
this.cookie(key, "", { ...options, expires: "Thu, 01 Jan 1970 00:00:00 GMT" });
}

@@ -35,0 +33,0 @@ // Response lifecycle methods.

@@ -157,11 +157,14 @@ import { match } from "path-to-regexp";

static serializeResponse(res) {
// Default to 200 / 204 if no status was set by middleware / route handler.
if (res.status === 0) {
res.status = Boolean(res.body) ? 200 : 204;
}
return new Response(res.body, {
const response = new Response(res.body, {
headers: res.headers,
status: res.status,
// Default to 200 / 204 if no status was set by middleware / route handler.
status: res.status ? res.status : Boolean(res.body) ? 200 : 204,
});
if (res.headers.cookies.size) {
// Loop cookies manually to work around this issue: https://github.com/fastly/js-compute-runtime/issues/47
response.headers.delete("Set-Cookie");
res.headers.cookies.forEach((c) => response.headers.append("Set-Cookie", c));
}
return response;
}
}
{
"name": "@fastly/expressly",
"version": "1.0.0--canary.6.2595789627.0",
"version": "1.0.0--canary.7.2690874917.0",
"description": "Express-style router for Fastly's Compute@Edge.",

@@ -17,3 +17,3 @@ "main": "dist/index.js",

"prepublish": "tsc",
"dev": "nodemon --exec \"tsc\""
"dev": "tsc --watch"
},

@@ -34,5 +34,4 @@ "keywords": [

"@types/node": "^17.0.40",
"auto": "^10.37.1",
"auto": "^10.37.2",
"husky": "^8.0.1",
"nodemon": "^2.0.18",
"prettier": "^2.7.1",

@@ -48,3 +47,3 @@ "pretty-quick": "^3.1.3",

"cookie": "^0.5.0",
"core-js": "^3.23.3",
"core-js": "^3.23.5",
"path-to-regexp": "^6.2.1"

@@ -51,0 +50,0 @@ },

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