Skip to content

Refactor Header Tab #101

@NghiaTranUIT

Description

@NghiaTranUIT

Problem

The side effect is still there. is responsible to handle the SetCookie beside the Header.

I suggest refactoring:

  1. Remove these lines:
  const entries =
    tab === TAB.SET_COOKIE
      ? SetCookie.getKeyValueArray(headers)
      : convertObjToKeyValueArray(headers);
  const nameValueSetCookie =
    tab === TAB.SET_COOKIE ? SetCookie.getArrayNameValue(headers) : [];

=> headers from dataProvider should be KeyValue[]

  1. Refactor all headerDataProvider
https://github.com/ProxymanApp/proxyman-electron-app/blob/fcbcb1bc7a803c1fdb1bfd44d416646bed71296f/src/renderer/components/request-inspector.jsx#L66

to

const headerDataProvider = () => {
    return {
      headers: convertObjToKeyValueArray(request.headers),
      tab: TAB.HEADER,
    };
  };
  1. Refactor the Form, Query, Cookie Data Provider too. Make sure the headers is KeyValue[]

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request✅ DoneTicket is resolved

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions