Skip to content

Commit 0bb1deb

Browse files
authored
Merge pull request #56087 from nextcloud/chore/remove-oc-host
chore: remove deprecated hosts functions from OC
2 parents 9f40d4c + f4ebcc7 commit 0bb1deb

9 files changed

Lines changed: 14 additions & 69 deletions

File tree

core/src/OC/host.js

Lines changed: 0 additions & 42 deletions
This file was deleted.

core/src/OC/index.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,6 @@ import { currentUser, getCurrentUser } from './currentuser.js'
4949
import { debug } from './debug.js'
5050
import Dialogs from './dialogs.js'
5151
import EventSource from './eventsource.js'
52-
import {
53-
getHost,
54-
getHostName,
55-
getPort,
56-
getProtocol,
57-
} from './host.js'
5852
import L10N from './l10n.js'
5953
import {
6054
hideMenus,
@@ -179,14 +173,6 @@ export default {
179173
*/
180174
joinPaths,
181175

182-
/**
183-
* Host (url) helpers
184-
*/
185-
getHost,
186-
getHostName,
187-
getPort,
188-
getProtocol,
189-
190176
/**
191177
* @deprecated 20.0.0 use `getCanonicalLocale` from https://www.npmjs.com/package/@nextcloud/l10n
192178
*/

core/src/files/client.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* SPDX-License-Identifier: AGPL-3.0-or-later
55
*/
66

7+
import { getCurrentUser } from '@nextcloud/auth'
78
import escapeHTML from 'escape-html'
89
import $ from 'jquery'
910
import _ from 'underscore'
@@ -958,10 +959,10 @@ import logger from '../logger.js'
958959
}
959960

960961
const client = new OC.Files.Client({
961-
host: OC.getHost(),
962-
port: OC.getPort(),
963-
root: OC.linkToRemoteBase('dav') + '/files/' + OC.getCurrentUser().uid,
964-
useHTTPS: OC.getProtocol() === 'https',
962+
host: window.location.host,
963+
port: window.location.port,
964+
root: OC.linkToRemoteBase('dav') + '/files/' + getCurrentUser().uid,
965+
useHTTPS: window.location.protocol.startsWith('https'),
965966
})
966967
OC.Files._defaultClient = client
967968
return client

dist/core-files_client.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/core-files_client.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/core-login.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/core-login.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/core-main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/core-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)