Skip to content

Commit

Permalink
feat: specify maxContentLength to Infinity
Browse files Browse the repository at this point in the history
  • Loading branch information
targos committed Apr 11, 2018
1 parent 6c65a57 commit c1ec338
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ const kBaseHeaders = Symbol('baseHeaders');
const kRequest = Symbol('request');
const kSublevel = Symbol('sublevel');

function getAxios(options) {
return axios.create(
Object.assign(
{
maxContentLength: 1024 * 1024 * 1024
},
options
)
);
}

class ZenodoApi {
constructor(options) {
options = Object.assign({}, defaultOptions, options);
Expand Down Expand Up @@ -55,7 +66,7 @@ class ZenodoApi {

class ZenodoApiDepositions {
constructor(baseUrl, baseHeaders) {
this[kRequest] = axios.create({
this[kRequest] = getAxios({
baseURL: baseUrl + 'deposit/depositions',
headers: baseHeaders
});
Expand Down Expand Up @@ -105,7 +116,7 @@ class ZenodoApiDepositions {

class ZenodoApiFiles {
constructor(baseUrl, baseHeaders) {
this[kRequest] = axios.create({
this[kRequest] = getAxios({
baseURL: baseUrl + 'files',
headers: baseHeaders
});
Expand Down

0 comments on commit c1ec338

Please sign in to comment.