// Extract the attributes for the file request
$isFileRequest = false;
$attributes = $this->share->getAttributes();
- $nickName = $request->getHeader('X-NC-Nickname');
+ $nickName = $request->hasHeader('X-NC-Nickname') ? urldecode($request->getHeader('X-NC-Nickname')) : null;
if ($attributes !== null) {
$isFileRequest = $attributes->getAttribute('fileRequest', 'enabled') === true;
}
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
+import { defineAsyncComponent } from 'vue'
+import { getBuilder } from '@nextcloud/browser-storage'
import { getGuestNickname, setGuestNickname } from '@nextcloud/auth'
-import { spawnDialog } from '@nextcloud/dialogs'
import { getUploader } from '@nextcloud/upload'
-import { defineAsyncComponent } from 'vue'
+import { spawnDialog } from '@nextcloud/dialogs'
+
import logger from './services/logger'
-import { getBuilder } from '@nextcloud/browser-storage'
const storage = getBuilder('files_sharing').build()
*/
function registerFileRequestHeader(nickname: string) {
const uploader = getUploader()
- uploader.setCustomHeader('X-NC-Nickname', nickname)
+ uploader.setCustomHeader('X-NC-Nickname', encodeURIComponent(nickname))
logger.debug('Nickname header registered for uploader', { headers: uploader.customHeaders })
}