Skip to content

Commit

Permalink
Merge pull request #1681 from ably/1666-deprecate-headers-client-option
Browse files Browse the repository at this point in the history
[ECO-4667] Add a deprecation warning for the `headers` client option
  • Loading branch information
lawrence-forooghian authored Mar 11, 2024
2 parents 9836860 + c3edfb2 commit 8ae52e2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/common/lib/util/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@ export function normaliseOptions(options: DeprecatedClientOptions): NormalisedCl
Logger.deprecated('queueEvents', 'queueMessages');
options.queueMessages = options.queueEvents;
}
if (options.headers) {
Logger.deprecatedWithMsg(
'the `headers` client option',
'' /* there is no replacement; see DeprecatedClientOptions.headers */
);
}

if (options.fallbackHostsUseDefault) {
/* fallbackHostsUseDefault and fallbackHosts are mutually exclusive as per TO3k7 */
Expand Down
3 changes: 3 additions & 0 deletions src/common/types/ClientOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export type DeprecatedClientOptions = Modify<
wsHost?: string;
queueEvents?: boolean;
promises?: boolean;
/**
* This option dates back to the initial commit of the repo but was never in the specification and sounds like nobody is depending on it; Paddy said we can remove in v2 (see https://ably-real-time.slack.com/archives/CURL4U2FP/p1709909310332169?thread_ts=1709908997.753599&cid=CURL4U2FP)
*/
headers?: Record<string, string>;
}
>;
Expand Down

0 comments on commit 8ae52e2

Please sign in to comment.