Skip to content

Commit

Permalink
fix(ui5): update links
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudBuchholz committed May 18, 2024
1 parent 313d912 commit 05f9c6f
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 7 deletions.
4 changes: 3 additions & 1 deletion samples/openui5/proxy-csp-version.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"port": 8080,
"mappings": [{
"match": "/@openui5/([^/]*)/(.*)",
"url": "https://openui5.hana.ondemand.com/$1/resources/$2"
"url": "https://ui5.sap.com/$1/resources/$2"
}, {
"match": "/resources/(.*)",
"custom": "./proxy-version.js"
Expand All @@ -14,5 +14,7 @@
}, {
"match": "^/(.*)",
"file": "./webapp/$1"
}, {
"status": 404
}]
}
4 changes: 3 additions & 1 deletion samples/openui5/proxy-csp.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"port": 8080,
"mappings": [{
"match": "/resources/(.*)",
"url": "https://openui5.hana.ondemand.com/1.76.0/resources/$1"
"url": "https://ui5.sap.com/1.71.68/resources/$1"
}, {
"custom": "./csp.js"
}, {
Expand All @@ -11,5 +11,7 @@
}, {
"match": "^/(.*)",
"file": "./webapp/$1"
}, {
"status": 404
}]
}
2 changes: 1 addition & 1 deletion samples/openui5/proxy-version.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = async function (request, response, ui5Path) {
const { referer } = request.headers
const version = (/\bversion\b=(\d+\.\d+\.\d+)/.exec(referer) || [0, '1.76.0'])[1]
const version = (/\bversion\b=(\d+\.\d+\.\d+)/.exec(referer) || [0, '1.71.68'])[1]
response.writeHead(302, {
Location: `/@openui5/${version}/${ui5Path}`
})
Expand Down
2 changes: 1 addition & 1 deletion samples/openui5/redirect-csp.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"mappings": [{
"match": "/resources/(.*)",
"headers": {
"Location": "https://openui5.hana.ondemand.com/1.76.0/resources/$1"
"Location": "https://ui5.sap.com/1.71.68/resources/$1"
},
"status": 302
}, {
Expand Down
4 changes: 2 additions & 2 deletions samples/openui5/redirect-version.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module.exports = async function (request, response, ui5Path) {
const { referer } = request.headers
const version = (/\bversion\b=(\d+\.\d+\.\d+)/.exec(referer) || [0, '1.76.0'])[1]
const version = (/\bversion\b=(\d+\.\d+\.\d+)/.exec(referer) || [0, '1.71.68'])[1]
response.writeHead(302, {
Location: `https://openui5.hana.ondemand.com/${version}/resources/${ui5Path}`
Location: `https://ui5.sap.com/${version}/resources/${ui5Path}`
})
response.end()
}
2 changes: 2 additions & 0 deletions samples/openui5/redirect-version.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@
}, {
"match": "^/(.*)",
"file": "./webapp/$1"
}, {
"status": 404
}]
}
4 changes: 3 additions & 1 deletion samples/openui5/redirect.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"mappings": [{
"match": "/resources/(.*)",
"headers": {
"Location": "https://openui5.hana.ondemand.com/1.76.0/resources/$1"
"Location": "https://ui5.sap.com/1.71.68/resources/$1"
},
"status": 302
}, {
Expand All @@ -12,5 +12,7 @@
}, {
"match": "^/(.*)",
"file": "./webapp/$1"
}, {
"status": 404
}]
}
2 changes: 2 additions & 0 deletions samples/openui5/static.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@
}, {
"match": "^/(.*)",
"file": "./webapp/$1"
}, {
"status": 404
}]
}

0 comments on commit 05f9c6f

Please sign in to comment.