diff --git a/packages/insomnia/src/ui/components/key-value-editor/key-value-editor.tsx b/packages/insomnia/src/ui/components/key-value-editor/key-value-editor.tsx index 3d0b41804312..4ca64d5f5140 100644 --- a/packages/insomnia/src/ui/components/key-value-editor/key-value-editor.tsx +++ b/packages/insomnia/src/ui/components/key-value-editor/key-value-editor.tsx @@ -63,7 +63,7 @@ export const KeyValueEditor: FC = ({ // smelly const pairsWithIds = pairs.map(pair => ({ ...pair, id: pair.id || generateId('pair') })); - const readOnlyPairs = [ + const readOnlyWebsocketPairs = [ { name: 'Connection', value: 'Upgrade' }, { name: 'Upgrade', value: 'websocket' }, { name: 'Sec-WebSocket-Key', value: '' }, @@ -71,6 +71,11 @@ export const KeyValueEditor: FC = ({ { name: 'Sec-WebSocket-Extensions', value: 'permessage-deflate; client_max_window_bits' }, ].map(pair => ({ ...pair, id: generateId('pair') })); + const readOnlyHttpPairs = [ + { name: 'Accept', value: '*/*' }, + { name: 'Host', value: '' }, + ].map(pair => ({ ...pair, id: generateId('pair') })); + const readOnlyPairs = isWebSocketRequest ? readOnlyWebsocketPairs : readOnlyHttpPairs; const [showDescription, setShowDescription] = React.useState(false); return ( @@ -124,7 +129,7 @@ export const KeyValueEditor: FC = ({ addPair={() => { }} /> )} - {isWebSocketRequest ? readOnlyPairs.map(pair => ( + {readOnlyPairs.map(pair => (
  • @@ -145,7 +150,7 @@ export const KeyValueEditor: FC = ({
  • - )) : null} + ))} {pairsWithIds.map(pair => (