Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

168
Visualizações
Changing a value of an index in a buffer array

so I am using requestly to modify the http responses

function modifyResponse(args) {
  const {method, url, response, responseType, requestHeaders, requestData, responseJSON} = args;
  console.log(response)
  return response;
}

so this function returns response, response is the actual response coming from the server, I can change it with the function, the problem is this: when I console.log the response I get this

ArrayBuffer(53)
byteLength: 53
[[Prototype]]: ArrayBuffer
[[Int8Array]]: Int8Array(53)
[[Uint8Array]]: Uint8Array(53)
[[ArrayBufferByteLength]]: 53
[[ArrayBufferData]]: 629

https://ibb.co/zQVbvLq

I tried reading through the array (image above), and found out that it's all in ascii, that is not the problem,I want to do something like this

Int8Array[0] = 10

the problem is that I don't have the knowledge to do it, I don't know how to access Int8Array through the modifyResponse function.

I have to change the function to something like this :

function modifyResponse(args) {
  const {method, url, response, responseType, requestHeaders, requestData, responseJSON} = args;
  //console.log(response)
response[Int8Array[0]] = 10
  return response;
}

I basically have to access response then access Int8Array and then change the element at index 0, but it does not work :/ can anyone help me?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The [[Int8Array]] is an internal property - you cannot simply access it as you would with any other property.

If you want to edit the ArrayBuffer as an Int8Array you need to construct it like so:

const array = new Int8Array(response);
array[0] = 10;
return response;
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda