File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 77
88import 'dart:async' ;
99
10+ import 'package:coap/src/option/coap_option_type.dart' ;
1011import 'package:collection/collection.dart' ;
1112import 'package:meta/meta.dart' ;
1213
@@ -66,8 +67,14 @@ class CoapObserveClientRelation extends Stream<CoapResponse> {
6667 @internal
6768 CoapRequest cancellation () =>
6869 CoapRequest .get (_request.uri)
69- // Copy options, but set Observe to cancel
70- ..setOptions (_request.getAllOptions ())
70+ // Copy options except for URI host and Path, but set Observe to cancel
71+ ..setOptions (
72+ _request.getAllOptions ().skipWhile (
73+ (option) =>
74+ option.type == OptionType .uriHost ||
75+ option.type == OptionType .uriPath,
76+ ),
77+ )
7178 ..observe = ObserveRegistration .deregister.value
7279 // Use same Token
7380 ..token = _request.token
You can’t perform that action at this time.
0 commit comments