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

bloomreach-experience-react-sdk

Package Overview
Dependencies
Maintainers
16
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bloomreach-experience-react-sdk - npm Package Compare versions

Comparing version 0.5.1 to 0.5.2

2

package.json
{
"name": "bloomreach-experience-react-sdk",
"version": "0.5.1",
"version": "0.5.2",
"description": "BloomReach Experience SDK for React",

@@ -5,0 +5,0 @@ "keywords": [

@@ -464,2 +464,5 @@ # BloomReach Experience SDK for React

### Version 0.5.2
- Fixed bug with query string affecting on the path parsing.
### Version 0.5.1

@@ -466,0 +469,0 @@ - Fixed bug with preview update on the component properties dialog changes;

@@ -8,3 +8,3 @@ import globalCmsUrls from './cms-urls';

const urlPath = request.path;
const [urlPath, query = ''] = request.path.split('?', 2);
let hostname = request.hostname;

@@ -17,3 +17,3 @@ // remove port number from hostname

// detect if in CMS/preview mode
let preview = hasPreviewQueryParameter(urlPath);
let preview = hasPreviewQueryParameter(query);
if (!preview) {

@@ -37,5 +37,3 @@ preview = isMatchingPreviewHostname(hostname, cmsUrls);

path = results[pathIdx + 1] !== undefined ? results[pathIdx + 1] : '';
// query parameter is not needed for fetching API URL and can actually conflict with component rendering URLs
path = removeQueryParameter(path);
if (!preview) {

@@ -47,28 +45,10 @@ // otherwise use preview-prefix in URL-path to detect preview mode

return {
path: path,
preview: preview,
query: urlPath.split('?', 2)[1] || '',
};
return { path, preview, query };
}
function hasPreviewQueryParameter(urlPath) {
const queryStringIdx = urlPath.indexOf('?');
if (queryStringIdx !== -1) {
const queryString = urlPath.substring(queryStringIdx);
if (queryString.indexOf('?bloomreach-preview=true') !== -1 || queryString.indexOf('&bloomreach-preview=true') !== -1) {
return true;
}
}
return false;
function hasPreviewQueryParameter(query) {
return query.startsWith('bloomreach-preview=true')
|| query.indexOf('&bloomreach-preview=true') !== -1;
}
function removeQueryParameter(urlPath) {
const queryStringIdx = urlPath.indexOf('?');
if (queryStringIdx !== -1) {
return urlPath.substring(0, urlPath.indexOf('?'));
}
return urlPath;
}
// if hostname is different for preview and live,

@@ -75,0 +55,0 @@ // then hostname can be used to detect if we're in preview mode

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