# Chapter 8 " Add a last-modified header to the request"

**URL:** <https://forums.kodeco.com/t/chapter-8-add-a-last-modified-header-to-the-request/86804>\
**Category:** RxSwift\
**Created:** [November 1, 2019, 12:18pm UTC](https://forums.kodeco.com/t/chapter-8-add-a-last-modified-header-to-the-request/86804 "2019-11-01T12:18:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/mike/32/102075_2.png) [@mike](https://forums.kodeco.com/u/mike)\
**Post date:** [November 1, 2019, 12:18pm UTC](https://forums.kodeco.com/t/chapter-8-add-a-last-modified-header-to-the-request/86804/1 "2019-11-01T12:18:44Z")

</div>

After the new Relay created:

```
“private let lastModified = BehaviorRelay<String?>(value: nil)”

```

, then accept() was called two times:

```
“if let lastModifiedString = try? String(contentsOf: modifiedFileURL, encoding: .utf8) {
 lastModified.accept(lastModifiedString)

```

}

and

```
“.subscribe(onNext: { [weak self] modifiedHeader in
  guard let self = self else { return }

  self.lastModified.accept(modifiedHeader)
  try? modifiedHeader.write(to: self.modifiedFileURL, atomically: true, encoding: .utf8)
 })
 .disposed(by: bag)

```

My **question** is: This behaviorRelay **lastModified** was **never**  **subscribed** , so how the **accept()** will work?

Thanks,  
Mike

---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [January 11, 2020, 3:26pm UTC](https://forums.kodeco.com/t/chapter-8-add-a-last-modified-header-to-the-request/86804/2 "2020-01-11T15:26:07Z")

</div>

@mike Do you still have issues with this?

---

<div class="post-metadata">

**Author:** ![mike](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/mike/32/102075_2.png) [@mike](https://forums.kodeco.com/u/mike)\
**Post date:** [January 11, 2020, 3:55pm UTC](https://forums.kodeco.com/t/chapter-8-add-a-last-modified-header-to-the-request/86804/3 "2020-01-11T15:55:10Z")

</div>

Thanks for asking. I am ok with this now.

---

<div class="post-metadata">

**Author:** ![system](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@system](https://forums.kodeco.com/u/system)\
**Post date:** [April 16, 2020, 4:18am UTC](https://forums.kodeco.com/t/chapter-8-add-a-last-modified-header-to-the-request/86804/4 "2020-04-16T04:18:44Z")

</div>

This topic was automatically closed after 166 days. New replies are no longer allowed.
