mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
[ui] Unescape csi/ in plugin GET requests (#23625)
* Unescape csi/ in plugin GET requests * CSI de-prefixing no longer necessary in mirage mocked endpoint
This commit is contained in:
3
.changelog/23625.txt
Normal file
3
.changelog/23625.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
```release-note:bug
|
||||
ui: Fixed storage/plugin 404s by unescaping a slash character in the request URL
|
||||
```
|
||||
@@ -11,4 +11,11 @@ export default class PluginAdapter extends Watchable {
|
||||
queryParamsToAttrs = {
|
||||
type: 'type',
|
||||
};
|
||||
// Over in serializers/plugin.js, we prepend csi/ as part of the hash ID for request resolution reasons.
|
||||
// However, this is not part of the actual ID stored in the database and we should treat it like a regular, unescaped
|
||||
// path segment.
|
||||
urlForFindRecord() {
|
||||
let url = super.urlForFindRecord(...arguments);
|
||||
return url.replace('csi%2F', 'csi/');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -673,13 +673,8 @@ export default function () {
|
||||
return this.serialize(csiPlugins.all());
|
||||
});
|
||||
|
||||
this.get('/plugin/:id', function ({ csiPlugins }, { params }) {
|
||||
if (!params.id.startsWith('csi/')) {
|
||||
return new Response(404, {}, null);
|
||||
}
|
||||
|
||||
const id = params.id.replace(/^csi\//, '');
|
||||
const volume = csiPlugins.find(id);
|
||||
this.get('/plugin/csi/:id', function ({ csiPlugins }, { params }) {
|
||||
const volume = csiPlugins.find(params.id);
|
||||
|
||||
if (!volume) {
|
||||
return new Response(404, {}, null);
|
||||
|
||||
Reference in New Issue
Block a user