# Requesting virtual-style URL for Hosted Mender artifacts on AWS S3

**URL:** https://hub.mender.io/t/requesting-virtual-style-url-for-hosted-mender-artifacts-on-aws-s3/4299
**Category:** General Discussions
**Created:** [November 10, 2021, 9:47pm UTC](https://hub.mender.io/t/requesting-virtual-style-url-for-hosted-mender-artifacts-on-aws-s3/4299 "2021-11-10T21:47:32Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![nowls](https://avatars.discourse-cdn.com/v4/letter/n/919ad9/32.png) [@nowls](https://hub.mender.io/u/nowls)
#### Post date: [November 10, 2021, 11:53pm UTC](https://hub.mender.io/t/requesting-virtual-style-url-for-hosted-mender-artifacts-on-aws-s3/4299/2 "2021-11-10T23:53:12Z")

</div>

Upon looking at your client implementation and API documentation, it appears that [Artifact.Source.URI](https://github.com/mendersoftware/mender/blob/77b30039a8fc6a0d1ea164474a9dfe7b927cffd3/datastore/statedata.go#L247) may be something that’s fetched over an API at [hosted.mender.io](http://hosted.mender.io) and that there is no client-side control to the artifact URI returned.

I suppose I could try to patch the client to rewrite the returned URI on the fly in order to test out alternate paths in the hope that AWS S3 will route them to the same bucket. However this example URI from a [tutorial implementing a custom Mender client](https://hub.mender.io/t/how-to-write-a-custom-client-interfacing-a-mender-server/1353), it looks like an [AWS pre-signed URL](https://docs.aws.amazon.com/AmazonS3/latest/userguide/ShareObjectPreSignedURL.html), and it specifies that the `host` header is part of the AWS4 signature (see `X-Amz-SignedHeaders=host` in the parameters). So that approach is likely to result in AWS rejecting the request if I modify the host string.

```auto
"uri": "https://s3.amazonaws.com/hosted-mender-artifacts/5b48937d7e71f600014ab529/af0ccfb3-c410-40f8-9b30-649e5dd7878c?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIAQWI25QR6NDTJ7DLD%2F20191213%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20191213T204753Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&response-content-type=application%2Fvnd.mender-artifact&X-Amz-Signature=3923b3238890ea98e51c6943805900570f306d1aaa858eedfd6b3ef1417dfd1b"

```

---

_[View the full topic](https://hub.mender.io/t/requesting-virtual-style-url-for-hosted-mender-artifacts-on-aws-s3/4299)._
