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

oohttp

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oohttp - npm Package Compare versions

Comparing version 1.2.1 to 2.0.0

7

CHANGELOG.md

@@ -9,2 +9,6 @@ # Change Log

## [2.0.0][]
### Changed
- Relative pathnames are respected when merging Url's through `url.mergeFrom()`. If a path starts with a slash, it overwrites the entire path from the merge url. Otherwise it is appended. This affects methods on `oohttp.Base` handling as well.
## [1.1.1][]

@@ -20,4 +24,5 @@ ### Fixed

[Unreleased]: https://github.com/SpectrumBroad/oohttp/compare/v1.1.1...HEAD
[Unreleased]: https://github.com/SpectrumBroad/oohttp/compare/v2.0.0...HEAD
[2.0.0]: https://github.com/SpectrumBroad/oohttp/compare/v1.1.1...v2.0.0
[1.1.1]: https://github.com/SpectrumBroad/oohttp/compare/v1.1.0...v1.1.1
[1.1.0]: https://github.com/SpectrumBroad/oohttp/compare/v1.0.0...v1.1.0

@@ -213,3 +213,5 @@ 'use strict';

if (!this.pathname && baseUrl.pathname) {
if (baseUrl.pathname && this.pathname && this.pathname.at(0) !== '/') {
this.pathname = `${baseUrl.pathname}${baseUrl.pathname.at(-1) === '/' ? '' : '/'}${this.pathname}`;
} else if (!this.pathname && baseUrl.pathname) {
this.pathname = baseUrl.pathname;

@@ -280,2 +282,6 @@ }

if (this.pathname) {
if (this.pathname.at(0) !== '/') {
str += '/';
}
str += this.pathname;

@@ -282,0 +288,0 @@ }

2

package.json
{
"name": "oohttp",
"version": "1.2.1",
"version": "2.0.0",
"description": "object-oriented http(s) request handler",

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

@@ -173,2 +173,14 @@ 'use strict';

});
it('toString should respect absolute path', function () {
const url = new oohttp.Url('/path/somewhere');
url.mergeFrom('http://test.test.test/pathname');
assert.strictEqual('http://test.test.test/path/somewhere', url.toString());
});
it('toString should respect relative path', function () {
const url = new oohttp.Url('path/somewhere');
url.mergeFrom('http://test.test.test/pathname');
assert.strictEqual('http://test.test.test/pathname/path/somewhere', url.toString());
});
});

@@ -175,0 +187,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