Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions lib/process.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,20 +348,6 @@ function processHeaders(responseCode, op, path, top, options) {
var headers = {};
var levels = [path.path, op.method, responseCode]

// check custom request values for any desired headers; cascading merge
if (options.customValues) {
var curr = options.customValues

var ndx = 0
do {
if (curr['header'] !== undefined) {
headers = merge2(curr['header'], headers)
}

curr = curr[levels[ndx]]
} while (ndx++ < levels.length && curr !== undefined)
}

// handle consumes
if (options.consumes) { // a specific content-type was targeted
if (op.definitionFullyResolved.consumes) {
Expand Down Expand Up @@ -405,6 +391,20 @@ function processHeaders(responseCode, op, path, top, options) {
headers['Accept'] = top.produces[0];
}

// check custom request values for any desired headers; cascading merge
if (options.customValues) {
var curr = options.customValues

var ndx = 0
do {
if (curr['header'] !== undefined) {
headers = merge2(curr['header'], headers)
}

curr = curr[levels[ndx]]
} while (ndx++ < levels.length && curr !== undefined)
}

return headers
}

Expand Down