Socket
Socket
Sign inDemoInstall

@sveltejs/kit

Package Overview
Dependencies
Maintainers
0
Versions
785
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sveltejs/kit - npm Package Compare versions

Comparing version 2.5.17 to 2.5.18

4

package.json
{
"name": "@sveltejs/kit",
"version": "2.5.17",
"version": "2.5.18",
"description": "SvelteKit is the fastest way to build Svelte apps",

@@ -46,3 +46,3 @@ "keywords": [

"typescript": "^5.3.3",
"vite": "^5.2.8",
"vite": "^5.3.2",
"vitest": "^1.6.0"

@@ -49,0 +49,0 @@ },

@@ -59,3 +59,3 @@ import * as devalue from 'devalue';

* If this function or its return value isn't set, it
* - falls back to updating the `form` prop with the returned data if the action is one same page as the form
* - falls back to updating the `form` prop with the returned data if the action is on the same page as the form
* - updates `$page.status`

@@ -128,5 +128,9 @@ * - resets the `<form>` element and invalidates all data in case of successful submission with no redirect response

const enctype = event.submitter?.hasAttribute('formenctype')
? /** @type {HTMLButtonElement | HTMLInputElement} */ (event.submitter).formEnctype
: clone(form_element).enctype;
const form_data = new FormData(form_element);
if (DEV && clone(form_element).enctype !== 'multipart/form-data') {
if (DEV && enctype !== 'multipart/form-data') {
for (const value of form_data.values()) {

@@ -166,10 +170,27 @@ if (value instanceof File) {

try {
const headers = new Headers({
accept: 'application/json',
'x-sveltekit-action': 'true'
});
// do not explicitly set the `Content-Type` header when sending `FormData`
// or else it will interfere with the browser's header setting
// see https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest_API/Using_FormData_Objects#sect4
if (enctype !== 'multipart/form-data') {
headers.set(
'Content-Type',
/^(:?application\/x-www-form-urlencoded|text\/plain)$/.test(enctype)
? enctype
: 'application/x-www-form-urlencoded'
);
}
// @ts-expect-error `URLSearchParams(form_data)` is kosher, but typescript doesn't know that
const body = enctype === 'multipart/form-data' ? form_data : new URLSearchParams(form_data);
const response = await fetch(action, {
method: 'POST',
headers: {
accept: 'application/json',
'x-sveltekit-action': 'true'
},
headers,
cache: 'no-store',
body: form_data,
body,
signal: controller.signal

@@ -176,0 +197,0 @@ });

@@ -184,3 +184,3 @@ import fs from 'node:fs';

const found = files.find((file) => file.replace(/\.[^.]+$/, '') === base);
const found = files.find((file) => file.replace(/\.(js|ts)$/, '') === base);

@@ -187,0 +187,0 @@ if (found) return path.join(dir, found);

// generated during release, do not modify
/** @type {string} */
export const VERSION = '2.5.17';
export const VERSION = '2.5.18';

Sorry, the diff of this file is too big to display

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