We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
According to OpenAPI 3.x specification, it's possible to specify custom headers for parts of multipart requests via EncodingObject.headers
EncodingObject.headers
Pass the my-schema.yaml (see below) to the oas2har as follows:
my-schema.yaml
oas2har
import { oas2har } from '@har-sdk/oas'; import { readFile } from 'fs'; import { promisify } from 'util'; import { load } from 'js-yaml'; const content = await promisify(readFile)( './my-schema.yaml', 'utf8' ); const result = oas2har(load(content) as OpenAPIV3.Document);
openapi: 3.0.1 info: title: Custom headers in multipart form-data version: 1.0.0 servers: - url: https://brightsec.com paths: /upload: post: requestBody: content: multipart/form-data: schema: type: object properties: image: {} encoding: image: contentType: image/png, image/jpeg headers: X-Custom-Header: schema: type: string required: true responses: 201: description: Successful upload content: {}
Multipart form data in HAR entry postData doesn't include X-Custom-Header:
postData
X-Custom-Header
"postData": { "mimeType": "multipart/form-data; boundary=956888039105887155673143", "text": "--956888039105887155673143\r\nContent-Disposition: form-data; name=\"image\"; filename=\"image\"\r\nContent-Type: application/octet-stream\r\nContent-Transfer-Encoding: base64\r\n\r\niVBORw0KGgo=\r\n--9568880391058 87155673143--" }
X-Custom-Header presents in postData
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
According to OpenAPI 3.x specification, it's possible to specify custom headers for parts of multipart requests via
EncodingObject.headers
Steps to reproduce
Pass the
my-schema.yaml
(see below) to theoas2har
as follows:my-schema.yaml
Actual result
Multipart form data in HAR entry
postData
doesn't includeX-Custom-Header
:Expected result
X-Custom-Header
presents inpostData
The text was updated successfully, but these errors were encountered: