Skip to content

Commit

Permalink
chore: http2 option
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirvolek committed Nov 19, 2021
1 parent 1c79539 commit 14b1401
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@blockfrost/blockfrost-js",
"version": "3.0.0-beta.2",
"version": "3.0.0-beta.3",
"description": "A JavaScript/TypeScript SDK for interacting with the https://blockfrost.io API",
"keywords": [
"blockfrost",
Expand Down
2 changes: 2 additions & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ type OptionCombination2 = {
type AdditionalOptions = {
isTestnet?: boolean;
version?: number;
http2?: boolean;
userAgent?: string;
requestTimeout?: number;
retrySettings?: RequiredRetryOptions;
Expand All @@ -50,6 +51,7 @@ export interface ValidatedOptions {
customBackend?: string;
version: number;
requestTimeout: number;
http2?: boolean;
projectId?: string;
isTestnet?: boolean;
retrySettings?: RequiredRetryOptions;
Expand Down
2 changes: 1 addition & 1 deletion src/utils/got.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const getInstance = (
got.extend({
prefixUrl: apiUrl,
responseType: 'json',
http2: true,
http2: options.http2,
headers: {
project_id: options.projectId,
userAgent: userAgent,
Expand Down
1 change: 1 addition & 0 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export const validateOptions = (options?: Options): ValidatedOptions => {
projectId: options.projectId,
isTestnet: options.isTestnet,
version: options.version || DEFAULT_API_VERSION,
http2: options.http2 || true,
// see: https://github.com/sindresorhus/got/blob/main/documentation/7-retry.md#retry
retrySettings: options.retrySettings,
requestTimeout: options.requestTimeout ?? 20000, // 20 seconds
Expand Down

0 comments on commit 14b1401

Please sign in to comment.