New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@effect/platform

Package Overview
Dependencies
Maintainers
3
Versions
421
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@effect/platform - npm Package Compare versions

Comparing version 0.16.0 to 0.16.1

1

Http/IncomingMessage.d.ts

@@ -28,2 +28,3 @@ import * as Option from "@effect/data/Option";

readonly headers: Headers.Headers;
readonly remoteAddress: Option.Option<string>;
readonly json: Effect.Effect<never, E, unknown>;

@@ -30,0 +31,0 @@ readonly text: Effect.Effect<never, E, string>;

7

Http/ServerRequest.d.ts

@@ -44,4 +44,7 @@ /**

readonly formDataStream: Stream.Stream<never, FormData.FormDataError, FormData.Part>;
readonly setUrl: (url: string) => ServerRequest;
readonly replaceHeaders: (headers: Headers.Headers) => ServerRequest;
readonly modify: (options: {
readonly url?: string;
readonly headers?: Headers.Headers;
readonly remoteAddress?: string;
}) => ServerRequest;
}

@@ -48,0 +51,0 @@ /**

@@ -7,2 +7,3 @@ "use strict";

exports.schemaJson = exports.fromWeb = exports.TypeId = void 0;
var Option = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/Option"));
var Effect = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/Effect"));

@@ -36,2 +37,5 @@ var Headers = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/Http/Headers"));

}
get remoteAddress() {
return Option.none();
}
get stream() {

@@ -38,0 +42,0 @@ return this.source.body ? Stream.fromReadableStream(() => this.source.body, _ => internalError.responseError({

@@ -45,3 +45,6 @@ "use strict";

exports.b3Response = b3Response;
const xForwardedHeaders = /*#__PURE__*/make(httpApp => Effect.updateService(httpApp, ServerRequest.ServerRequest, request => request.headers["x-forwarded-host"] ? request.replaceHeaders(Headers.set(request.headers, "host", request.headers["x-forwarded-host"])) : request));
const xForwardedHeaders = /*#__PURE__*/make(httpApp => Effect.updateService(httpApp, ServerRequest.ServerRequest, request => request.headers["x-forwarded-host"] ? request.modify({
headers: Headers.set(request.headers, "host", request.headers["x-forwarded-host"]),
remoteAddress: request.headers["x-forwarded-for"]?.split(",")[0].trim()
}) : request));
/** @internal */

@@ -48,0 +51,0 @@ exports.xForwardedHeaders = xForwardedHeaders;

@@ -135,3 +135,5 @@ "use strict";

const prefexLen = prefix.length;
return request.setUrl(request.url.length <= prefexLen ? "/" : request.url.slice(prefexLen));
return request.modify({
url: request.url.length <= prefexLen ? "/" : request.url.slice(prefexLen)
});
}

@@ -138,0 +140,0 @@ class RouteImpl {

{
"name": "@effect/platform",
"version": "0.16.0",
"version": "0.16.1",
"description": "Unified interfaces for common platform-specific services",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -37,2 +37,3 @@ /**

readonly headers: Headers.Headers
readonly remoteAddress: Option.Option<string>
readonly json: Effect.Effect<never, E, unknown>

@@ -39,0 +40,0 @@ readonly text: Effect.Effect<never, E, string>

@@ -52,4 +52,9 @@ /**

readonly setUrl: (url: string) => ServerRequest
readonly replaceHeaders: (headers: Headers.Headers) => ServerRequest
readonly modify: (
options: {
readonly url?: string
readonly headers?: Headers.Headers
readonly remoteAddress?: string
}
) => ServerRequest
}

@@ -56,0 +61,0 @@

@@ -0,1 +1,2 @@

import * as Option from "@effect/data/Option"
import * as Effect from "@effect/io/Effect"

@@ -42,2 +43,6 @@ import type * as Error from "@effect/platform/Http/ClientError"

get remoteAddress(): Option.Option<string> {
return Option.none()
}
get stream(): Stream.Stream<never, Error.ResponseError, Uint8Array> {

@@ -44,0 +49,0 @@ return this.source.body

@@ -78,7 +78,10 @@ import { flow } from "@effect/data/Function"

request.headers["x-forwarded-host"]
? request.replaceHeaders(Headers.set(
request.headers,
"host",
request.headers["x-forwarded-host"]
))
? request.modify({
headers: Headers.set(
request.headers,
"host",
request.headers["x-forwarded-host"]
),
remoteAddress: request.headers["x-forwarded-for"]?.split(",")[0].trim()
})
: request)

@@ -85,0 +88,0 @@ )

@@ -168,3 +168,3 @@ import * as Chunk from "@effect/data/Chunk"

const prefexLen = prefix.length
return request.setUrl(request.url.length <= prefexLen ? "/" : request.url.slice(prefexLen))
return request.modify({ url: request.url.length <= prefexLen ? "/" : request.url.slice(prefexLen) })
}

@@ -171,0 +171,0 @@

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

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

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

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

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