Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat(capabilities): Expose if mod-rewrite is working via capabilities
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Apr 12, 2024
commit bbaaaf4b91beb6ade321c082d3f8231216eb368b
6 changes: 5 additions & 1 deletion core/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@
"pollinterval",
"webdav-root",
"reference-api",
"reference-regex"
"reference-regex",
"mod-rewrite-working"
],
"properties": {
"pollinterval": {
Expand All @@ -113,6 +114,9 @@
},
"reference-regex": {
"type": "string"
},
"mod-rewrite-working": {
"type": "boolean"
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions lib/private/OCS/CoreCapabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public function __construct(
* webdav-root: string,
* reference-api: boolean,
* reference-regex: string,
* mod-rewrite-working: boolean,
* },
* }
*/
Expand All @@ -59,6 +60,7 @@ public function getCapabilities(): array {
'webdav-root' => $this->config->getSystemValueString('webdav-root', 'remote.php/webdav'),
'reference-api' => true,
'reference-regex' => IURLGenerator::URL_REGEX_NO_MODIFIERS,
'mod-rewrite-working' => $this->config->getSystemValueBool('htaccess.IgnoreFrontController') || getenv('front_controller_active') === 'true',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a copy-paste of

'modRewriteWorking' => $this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true',

Can we then use capabilities there to define modRewriteWorking in JSConfig?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could

],
];
}
Expand Down