Skip to content

Commit

Permalink
core/io: add block flag headers iff non-empty
Browse files Browse the repository at this point in the history
  • Loading branch information
ignoramous committed Sep 27, 2024
1 parent 45c0799 commit ad46d2e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/core/io-state.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,11 @@ export default class IOState {
}

headers(b = null) {
const xNileFlags = this.isDnsBlock ? { "x-nile-flags": this.flag } : null;
const xNileFlagsOk = !xNileFlags ? { "x-nile-flags-dn": this.flag } : null;
const hasBlockFlag = !util.emptyString(this.flag);
const isBlocked = hasBlockFlag && this.isDnsBlock;
const couldBlock = hasBlockFlag && !this.isDnsBlock;
const xNileFlags = isBlocked ? { "x-nile-flags": this.flag } : null;
const xNileFlagsOk = couldBlock ? { "x-nile-flags-dn": this.flag } : null;
const xNileRegion = !util.emptyString(this.region)
? { "x-nile-region": this.region }
: null;
Expand Down

0 comments on commit ad46d2e

Please sign in to comment.