# Fetch content and verify it from IPFS gateway

**URL:** <https://discuss.ipfs.tech/t/fetch-content-and-verify-it-from-ipfs-gateway/12524>\
**Category:** Help\
**Created:** [October 27, 2021, 8:29am UTC](https://discuss.ipfs.tech/t/fetch-content-and-verify-it-from-ipfs-gateway/12524 "2021-10-27T08:29:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pablo1](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/pablo1/32/5291_2.png) [@pablo1](https://discuss.ipfs.tech/u/pablo1)\
**Post date:** [October 27, 2021, 8:29am UTC](https://discuss.ipfs.tech/t/fetch-content-and-verify-it-from-ipfs-gateway/12524/1 "2021-10-27T08:29:49Z")

</div>

Hi there!

I have written some code to fetch and verify the content from an IPFS gateway by hashing the content and comparing it to the original CID hash. Check it out [https://github.com/dappnode/DNP\_DAPPMANAGER/blob/master/packages/dappmanager/src/modules/ipfs/getContentFromGateway.ts](https://github.com/dappnode/DNP_DAPPMANAGER/blob/master/packages/dappmanager/src/modules/ipfs/getContentFromGateway.ts)

I am not sure if this verification is already done by the IPFS-CAR library, can anybody clarify it?

Also, I was trying to create a “fake” ipfs gateway to expose the `/dag/export` endpoint and serve a modified CAR content to check that my code works propertly. I am having troubles how to serve CAR content through an API, can anyone help me please?

Thank u in advanced!

---

<div class="post-metadata">

**Author:** ![d10r](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/d10r/32/3960_2.png) [@d10r](https://discuss.ipfs.tech/u/d10r)\
**Post date:** [December 16, 2021, 8:12pm UTC](https://discuss.ipfs.tech/t/fetch-content-and-verify-it-from-ipfs-gateway/12524/2 "2021-12-16T20:12:04Z")

</div>

Hi  
Just wanted to comment that a lightweight lib which does just that - verify the integrity of files downloaded via gateway - would imho be super useful. Without it, the convenience of using public gateways comes at the price of losing the main benefit of IPFS - guaranteed integrity.
