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

next-ssl-redirect-middleware

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-ssl-redirect-middleware - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

.eslintrc.json

3

dist/index.js

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

if (environments.includes(currentEnv) && req.headers.get("x-forwarded-proto") !== "https") {
return server_1.NextResponse.redirect(`https://${req.nextUrl.hostname}${req.nextUrl.pathname}`, status);
const hostname = req.headers.get('host') || req.nextUrl.hostname;
return server_1.NextResponse.redirect(`https://${hostname}${req.nextUrl.pathname}`, status);
}

@@ -10,0 +11,0 @@ return server_1.NextResponse.next();

{
"name": "next-ssl-redirect-middleware",
"version": "0.1.3",
"version": "0.1.4",
"description": "Nextjs Middleware to redirect http to https",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -17,3 +17,4 @@ import { NextFetchEvent, NextRequest, NextResponse } from 'next/server'

if (environments.includes(currentEnv) && req.headers.get("x-forwarded-proto") !== "https") {
return NextResponse.redirect(`https://${req.nextUrl.hostname}${req.nextUrl.pathname}`, status);
const hostname = req.headers.get('host') || req.nextUrl.hostname;
return NextResponse.redirect(`https://${hostname}${req.nextUrl.pathname}`, status);
}

@@ -23,2 +24,2 @@ return NextResponse.next();

export default middleware;
export default middleware;
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