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

@podium/utils

Package Overview
Dependencies
Maintainers
6
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@podium/utils - npm Package Compare versions

Comparing version 5.0.0-next.8 to 5.0.0-next.9

7

CHANGELOG.md

@@ -0,1 +1,8 @@

# [5.0.0-next.9](https://github.com/podium-lib/utils/compare/v5.0.0-next.8...v5.0.0-next.9) (2022-10-09)
### Bug Fixes
* Remove original url module ([#185](https://github.com/podium-lib/utils/issues/185)) ([6c01c0f](https://github.com/podium-lib/utils/commit/6c01c0f44e3b24c7f481a2504003903529e8f80e))
# [5.0.0-next.8](https://github.com/podium-lib/utils/compare/v5.0.0-next.7...v5.0.0-next.8) (2022-05-04)

@@ -2,0 +9,0 @@

22

lib/http-incoming.js

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

import originalUrl from 'original-url';
import { URL } from 'url';
import { URL } from 'node:url';

@@ -7,8 +6,6 @@ const inspect = Symbol.for('nodejs.util.inspect.custom');

const urlFromRequest = request => {
try {
const url = originalUrl(request);
return new URL(url.raw, `${url.protocol}//${request.headers.host}`);
} catch (err) {
return {};
}
const protocol = request?.protocol || 'http';
const host = request?.headers?.host || 'localhost';
const url = request?.url || '';
return new URL(url, `${protocol.replace(/:/, '')}://${host}`);
};

@@ -29,3 +26,2 @@

constructor(request = {}, response = {}, params = {}) {
const url = urlFromRequest(request);
this.#development = false;

@@ -39,3 +35,3 @@ this.#response = response;

this.#view = {};
this.#url = url;
this.#url = undefined;
this.#css = [];

@@ -135,7 +131,8 @@ this.#js = [];

set url(value) {
this.#url = value;
this.#url = new URL(value);
}
get url() {
return this.#url;
if (this.#url) return this.#url;
return urlFromRequest(this.#request);;
}

@@ -197,2 +194,1 @@

};
// export default HttpIncoming;
{
"name": "@podium/utils",
"version": "5.0.0-next.8",
"version": "5.0.0-next.9",
"description": "Common generic utility methods shared by @podium modules.",

@@ -41,7 +41,3 @@ "type": "module",

"@semantic-release/changelog": "6.0.1",
"@semantic-release/commit-analyzer": "9.0.2",
"@semantic-release/git": "10.0.1",
"@semantic-release/github": "8.0.4",
"@semantic-release/npm": "9.0.1",
"@semantic-release/release-notes-generator": "10.0.3",
"benchmark": "2.1.4",

@@ -59,5 +55,4 @@ "eslint": "8.14.0",

"dependencies": {
"camelcase": "6.3.0",
"original-url": "1.2.3"
"camelcase": "6.3.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