Skip to content

Commit

Permalink
fix content-type for documents (#22)
Browse files Browse the repository at this point in the history
* fix content-type for documents

* updated changelog

* enable auth
  • Loading branch information
bjolind authored May 20, 2021
1 parent af51527 commit 1417a35
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 34 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased](https://github.com/promaster-sdk/api-server/compare/v2.4.0...master)

- Fix content type. See PR [#22](https://github.com/promaster-sdk/api-server/pull/22).

## [2.4.0](https://github.com/promaster-sdk/api-server/compare/v2.3.1...v2.4.0)

### Added
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@types/koa-graphql": "^0.8.3",
"@types/koa-mount": "^3.0.1",
"@types/koa-multer": "^1.0.0",
"@types/koa-send": "^3.3.1",
"@types/koa-send": "^4.1.2",
"@types/koa__cors": "^2.2.3",
"@types/koa__router": "^8.0.3",
"@types/mkdirp": "^0.5.2",
Expand Down Expand Up @@ -70,7 +70,7 @@
"koa-graphql": "^0.8.0",
"koa-mount": "^3.0.0",
"koa-multer": "^1.0.2",
"koa-send": "^4.1.1",
"koa-send": "^5.0.1",
"mimetype": "^0.0.8",
"mkdirp": "^0.5.1",
"multer": "^1.3.1",
Expand Down
4 changes: 2 additions & 2 deletions src/client-rest/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ function blobHandler(getFilesDir: GetFilesDir): Koa.Middleware {
}
const contentType = mimetype.lookup(fileName || "file");
if (contentType) {
ctx.headers["Content-Type"] = contentType;
ctx.type = contentType;
} else {
ctx.headers["Content-Type"] = "application/octet-stream";
ctx.type = "application/octet-stream";
}

if (fileName && attachment) {
Expand Down
43 changes: 13 additions & 30 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -499,10 +499,10 @@
dependencies:
"@types/koa" "*"

"@types/koa-send@^3.3.1":
version "3.3.1"
resolved "https://registry.yarnpkg.com/@types/koa-send/-/koa-send-3.3.1.tgz#e7d37174070ad8b376b68d2deb0ab3fc05a14f58"
integrity sha512-0VN8Qbje3EbnD4+YUlDootF5C+bEZep5Xgj6ia6Ve03gyNyDYw0dzBCxVck340ySCX63fmZWAgpinEbcMVU8ag==
"@types/koa-send@^4.1.2":
version "4.1.2"
resolved "https://registry.yarnpkg.com/@types/koa-send/-/koa-send-4.1.2.tgz#978f8267ad116d12ac6a18fecd8f34c5657e09ad"
integrity sha512-rfqKIv9bFds39Jxvsp8o3YJLnEQVPVriYA14AuO2OY65IHh/4UX4U/iMs5L0wATpcRmm1bbe0BNk23TRwx3VQQ==
dependencies:
"@types/koa" "*"

Expand Down Expand Up @@ -1158,7 +1158,7 @@ debug@=3.1.0, debug@~3.1.0:
dependencies:
ms "2.0.0"

debug@^2.2.0, debug@^2.3.3, debug@^2.6.1, debug@^2.6.3:
debug@^2.2.0, debug@^2.3.3, debug@^2.6.1:
version "2.6.9"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==
Expand Down Expand Up @@ -1674,7 +1674,7 @@ http-errors@1.7.3, http-errors@~1.7.2:
statuses ">= 1.5.0 < 2"
toidentifier "1.0.0"

http-errors@^1.6.1, http-errors@^1.6.3, http-errors@^1.7.1, http-errors@^1.7.3:
http-errors@^1.6.3, http-errors@^1.7.1, http-errors@^1.7.3:
version "1.8.0"
resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.0.tgz#75d1bbe497e1044f51e4ee9e704a62f28d336507"
integrity sha512-4I8r0C5JDhT5VkvI47QktDW75rNlGVsUf/8hzjCC/wkWI/jdTRmBb9aI7erSG82r1bjKY3F6k28WnsVxB1C73A==
Expand Down Expand Up @@ -2144,14 +2144,13 @@ koa-multer@^1.0.2:
dependencies:
multer "1.3.0"

koa-send@^4.1.1:
version "4.1.3"
resolved "https://registry.yarnpkg.com/koa-send/-/koa-send-4.1.3.tgz#0822207bbf5253a414c8f1765ebc29fa41353cb6"
integrity sha512-3UetMBdaXSiw24qM2Mx5mKmxLKw5ZTPRjACjfhK6Haca55RKm9hr/uHDrkrxhSl5/S1CKI/RivZVIopiatZuTA==
koa-send@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/koa-send/-/koa-send-5.0.1.tgz#39dceebfafb395d0d60beaffba3a70b4f543fe79"
integrity sha512-tmcyQ/wXXuxpDxyNXv5yNNkdAMdFRqwtegBXUaowiQzUKqJehttS0x2j0eOZDQAyloAth5w6wwBImnFzkUz3pQ==
dependencies:
debug "^2.6.3"
http-errors "^1.6.1"
mz "^2.6.0"
debug "^4.1.1"
http-errors "^1.7.3"
resolve-path "^1.4.0"

koa@^2.4.1:
Expand Down Expand Up @@ -2555,15 +2554,6 @@ multer@^1.3.1:
type-is "^1.6.4"
xtend "^4.0.0"

mz@^2.6.0:
version "2.7.0"
resolved "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32"
integrity sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==
dependencies:
any-promise "^1.0.0"
object-assign "^4.0.1"
thenify-all "^1.0.0"

nan@^2.13.2:
version "2.14.2"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.2.tgz#f5376400695168f4cc694ac9393d0c9585eeea19"
Expand Down Expand Up @@ -3469,14 +3459,7 @@ tdigest@^0.1.1:
dependencies:
bintrees "1.0.1"

thenify-all@^1.0.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726"
integrity sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=
dependencies:
thenify ">= 3.1.0 < 4"

"thenify@>= 3.1.0 < 4", thenify@^3.3.0:
thenify@^3.3.0:
version "3.3.1"
resolved "https://registry.yarnpkg.com/thenify/-/thenify-3.3.1.tgz#8932e686a4066038a016dd9e2ca46add9838a95f"
integrity sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==
Expand Down

0 comments on commit 1417a35

Please sign in to comment.