bitfocus / companion-module-generic-http

Generic HTTP module
MIT License
9 stars 19 forks source link

Adds content type options #18

Closed josephdadams closed 2 years ago

josephdadams commented 2 years ago

Includes other options for content type and includes them in the header. Will require modifications to companion core which will be in another pull request there.

krocheck commented 2 years ago

this will not work correctly without an upgrade script to force existing actions to the new default content type. body will not parse as written without this because contenttype will not set just because a new field has a default assigned

josephdadams commented 2 years ago

Won’t it just be undefined?

krocheck commented 2 years ago

yeah, but read your code … body will not parse for existing actions by that logic. i’m guessing people use that field.

josephdadams commented 2 years ago

Well, if they used it before, it parsed correctly before and should be valid.

krocheck commented 2 years ago

all existing actions assumed application/json and body always tried a parse of body as json. you’re bypassing the parse of body for existing actions by not forcing this new field to its default for existing actions

josephdadams commented 2 years ago

Upgrade script and version bump it is then

estilles commented 2 years ago

Oh man. We forgot the upgrade script. My bad too. Should've caught that.