# Proposed service worker change

**URL:** <https://forum.dfinity.org/t/proposed-service-worker-change/15309>\
**Category:** Developers\
**Created:** [September 6, 2022, 6:00pm UTC](https://forum.dfinity.org/t/proposed-service-worker-change/15309 "2022-09-06T18:00:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulyoung](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/paulyoung/32/5251_2.png) [@paulyoung](https://forum.dfinity.org/u/paulyoung)\
**Post date:** [September 6, 2022, 6:00pm UTC](https://forum.dfinity.org/t/proposed-service-worker-change/15309/1 "2022-09-06T18:00:56Z")

</div>

Sharing here for visibility.

> <https://github.com/dfinity/ic/pull/53>
>
> This fixes the following issue. I was experiencing this when accessing my site t…hrough my custom domain name:
> 
> !\[\](https://user-images.githubusercontent.com/84700/188704975-ad28cce5-cfb6-4a0f-bd2c-e3296c94f996.jpg)
> 
> In case it's a factor here, I have 2 canisters; a frontend and backend canister. I would like to have a single canister ID/URL entry point, but I ran into the Wasm module function limit and also https://github.com/dfinity/cdk-rs/issues/310 when trying to do that.
> 
> I realize that this PR most likely will not be accepted as this repo isn't accepting outside contributions, but I think it's a good place to socialize the change.

---

<div class="post-metadata">

**Author:** ![domwoe](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/domwoe/32/5165_2.png) [@domwoe](https://forum.dfinity.org/u/domwoe)\
**Post date:** [September 7, 2022, 11:24am UTC](https://forum.dfinity.org/t/proposed-service-worker-change/15309/2 "2022-09-07T11:24:01Z")

</div>

FYI @raymondk @nathan.mcgrath

---

<div class="post-metadata">

**Author:** ![nathan.mcgrath](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/nathan.mcgrath/32/7204_2.png) [@nathan.mcgrath](https://forum.dfinity.org/u/nathan.mcgrath)\
**Post date:** [September 7, 2022, 3:28pm UTC](https://forum.dfinity.org/t/proposed-service-worker-change/15309/3 "2022-09-07T15:28:26Z")

</div>

Hello @paulyoung, thanks for bringing this up.

Are you using icfront with an updated version of the service worker from the master branch of ic repo?

---

<div class="post-metadata">

**Author:** ![paulyoung](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/paulyoung/32/5251_2.png) [@paulyoung](https://forum.dfinity.org/u/paulyoung)\
**Post date:** [September 7, 2022, 3:35pm UTC](https://forum.dfinity.org/t/proposed-service-worker-change/15309/4 "2022-09-07T15:35:36Z")

</div>

@nathan.mcgrath yes, I am.

---

<div class="post-metadata">

**Author:** ![nathan.mcgrath](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/nathan.mcgrath/32/7204_2.png) [@nathan.mcgrath](https://forum.dfinity.org/u/nathan.mcgrath)\
**Post date:** [September 7, 2022, 3:54pm UTC](https://forum.dfinity.org/t/proposed-service-worker-change/15309/5 "2022-09-07T15:54:45Z")

</div>

Thanks for confirming @paulyoung!

I’m sorry to say that you’ve uncovered a bug that only exists on the master branch, it’s currently not released to mainnet yet. Until I find a fix for this bug, I’d recommend rolling back to the 1.2.7 release and this should fix your issue: [ic/typescript/service-worker at service-worker\_v1.2.7 · dfinity/ic · GitHub](https://github.com/dfinity/ic/tree/service-worker_v1.2.7/typescript/service-worker)

Thanks again for bringing this to our attention.

---

<div class="post-metadata">

**Author:** ![paulyoung](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/paulyoung/32/5251_2.png) [@paulyoung](https://forum.dfinity.org/u/paulyoung)\
**Post date:** [September 7, 2022, 4:03pm UTC](https://forum.dfinity.org/t/proposed-service-worker-change/15309/6 "2022-09-07T16:03:39Z")

</div>

Looks like it was introduced here: [do not modify responses from outside ic · dfinity/ic@b4e811d · GitHub](https://github.com/dfinity/ic/commit/b4e811d82471df22459aa7131716679f4f287ef6)

My fix is working; do you have any security concerns or do you think it’s safe for me to keep in place?

---

<div class="post-metadata">

**Author:** ![nathan.mcgrath](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/nathan.mcgrath/32/7204_2.png) [@nathan.mcgrath](https://forum.dfinity.org/u/nathan.mcgrath)\
**Post date:** [September 7, 2022, 4:18pm UTC](https://forum.dfinity.org/t/proposed-service-worker-change/15309/7 "2022-09-07T16:18:10Z")

</div>

Yes, that’s exactly where the bug was introduced.

With your fix the service worker would not match the HTTP Gateway Protocol specification: [The Internet Computer Interface Specification | Internet Computer Home](https://internetcomputer.org/docs/current/references/ic-interface-spec/#http-gateway-name-resolution)

If we can fix this without changing the HTTP Gateway Protocol specification then that would be preferred, otherwise we would need to update the spec and update any other components that implement that spec.
