Compare commits

...

2 Commits

Author SHA1 Message Date
Codetrauma
fdaf6ca815 refactor: linting + deleting clogs 2024-06-14 14:36:44 -07:00
Codetrauma
511272a451 feat: adding content-length header to notarization 2024-06-14 14:18:33 -07:00
3 changed files with 4 additions and 8 deletions

View File

@@ -5,9 +5,8 @@ import React, {
useEffect,
useState,
} from 'react';
import { notarizeRequest, useRequest } from '../../reducers/requests';
import { useRequest } from '../../reducers/requests';
import classNames from 'classnames';
import { useDispatch } from 'react-redux';
import {
Route,
Routes,
@@ -19,14 +18,12 @@ import Icon from '../Icon';
import NavigateWithParams from '../NavigateWithParams';
import {
set,
get,
MAX_SENT_LS_KEY,
MAX_RECEIVED_LS_KEY,
getMaxRecv,
getMaxSent,
} from '../../utils/storage';
import { MAX_RECV, MAX_SENT } from '../../utils/constants';
import { urlify } from '../../utils/misc';
type Props = {
requestId: string;

View File

@@ -38,7 +38,6 @@ export const onSendHeaders = (
}
});
}
cache.set(requestId, {
...existing,
method: details.method as 'GET' | 'POST',
@@ -60,7 +59,6 @@ export const onBeforeRequest = (
const { method, requestBody, tabId, requestId } = details;
if (method === 'OPTIONS') return;
if (requestBody) {
const cache = getCacheByTabId(tabId);
const existing = cache.get<RequestLog>(requestId);
@@ -95,7 +93,6 @@ export const onResponseStarted = (
if (method === 'OPTIONS') return;
const cache = getCacheByTabId(tabId);
const existing = cache.get<RequestLog>(requestId);
const newLog: RequestLog = {
requestHeaders: [],

View File

@@ -52,7 +52,9 @@ export default function Notarize(): ReactElement {
//TODO: for some reason, these needs to be override to work
headers['Accept-Encoding'] = 'identity';
headers['Connection'] = 'close';
if (req.requestBody) {
headers['Content-Length'] = req.requestBody.length.toString();
}
dispatch(
// @ts-ignore
notarizeRequest({