Skip to content
This repository was archived by the owner on May 28, 2023. It is now read-only.

Commit a701ab8

Browse files
author
tkostuch
committed
Merge branch 'develop' of github.com:DivanteLtd/vue-storefront-api into bugfix/434
2 parents f54891a + 013d79b commit a701ab8

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2929
- disable showing stack for invalid requests - @gibkigonzo (#431)
3030
- Improve `_outputFormatter` on cache catalog-response to prevent exception - @cewald (#432)
3131
- use ts for compiling additional scripts - @gibkigonzo (#437)
32+
- Bugfix for wrong JSON scheme url's and hostname resolution for `magento1` platform - @cewald (#443)
3233
- check if headers has been already sent in image middleware - @gibkigonzo (#434)
3334

3435
## [1.11.1] - 2020.03.17

src/api/order.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import PlatformFactory from '../platform/factory';
55

66
const Ajv = require('ajv'); // json validator
77
const fs = require('fs');
8+
const path = require('path');
89
const kue = require('kue');
910
const jwa = require('jwa');
1011
const hmac = jwa('HS256');
@@ -29,7 +30,7 @@ export default ({ config, db }) => resource({
2930

3031
const orderSchema = require('../models/order.schema.js')
3132
let orderSchemaExtension = {}
32-
if (fs.existsSync('../models/order.schema.extension.json')) {
33+
if (fs.existsSync(path.resolve(__dirname, '../models/order.schema.extension.json'))) {
3334
orderSchemaExtension = require('../models/order.schema.extension.json')
3435
}
3536
const validate = ajv.compile(merge(orderSchema, orderSchemaExtension));

src/api/user.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { merge } from 'lodash';
66

77
const Ajv = require('ajv'); // json validator
88
const fs = require('fs');
9+
const path = require('path');
910

1011
function addUserGroupToken (config, result) {
1112
/**
@@ -36,7 +37,7 @@ export default ({config, db}) => {
3637
const ajv = new Ajv();
3738
const userRegisterSchema = require('../models/userRegister.schema.json')
3839
let userRegisterSchemaExtension = {};
39-
if (fs.existsSync('../models/userRegister.schema.extension.json')) {
40+
if (fs.existsSync(path.resolve(__dirname, '../models/userRegister.schema.extension.json'))) {
4041
userRegisterSchemaExtension = require('../models/userRegister.schema.extension.json');
4142
}
4243
const validate = ajv.compile(merge(userRegisterSchema, userRegisterSchemaExtension))
@@ -169,7 +170,7 @@ export default ({config, db}) => {
169170
const ajv = new Ajv();
170171
const userProfileSchema = require('../models/userProfile.schema.json')
171172
let userProfileSchemaExtension = {};
172-
if (fs.existsSync('../models/userProfile.schema.extension.json')) {
173+
if (fs.existsSync(path.resolve(__dirname, '../models/userProfile.schema.extension.json'))) {
173174
userProfileSchemaExtension = require('../models/userProfile.schema.extension.json');
174175
}
175176
const validate = ajv.compile(merge(userProfileSchema, userProfileSchemaExtension))

src/platform/magento1/util.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export function multiStoreConfig (apiConfig, req) {
1212
if (config.magento1['api_' + storeCode]) {
1313
confCopy = Object.assign({}, config.magento1['api_' + storeCode]) // we're to use the specific api configuration - maybe even separate magento instance
1414
} else {
15-
if (new RegExp('(/' + config.availableStores.join('|') + '/)', 'gm').exec(confCopy.url) === null) {
15+
if (new RegExp('/(' + config.availableStores.join('|') + ')/', 'gm').exec(confCopy.url) === null) {
1616
confCopy.url = (confCopy.url).replace(/(vsbridge)/gm, `${storeCode}/$1`);
1717
}
1818
}

0 commit comments

Comments
 (0)