Commit 8b73c2d
remotes: fix possible panic from WithMediaTypeKeyPrefix
As the same instance of a map is used in context and mutated
directly, this leads to a situation where:
- Calling WithMediaTypeKeyPrefix from parallel goroutines where
the context was based on the same base context can trigger a panic.
- A subcontext calling WithMediaTypeKeyPrefix changes the value for
another context when they both originate from the same base context.
Signed-off-by: Tonis Tiigi <[email protected]>1 parent 1c4457e commit 8b73c2d
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| |||
0 commit comments