←back to thread

755 points MedadNewman | 1 comments | | HN request time: 0.202s | source
Show context
lxe ◴[] No.42891381[source]
You can also intercept the xhr response which would still stop generation, but the UI won't update, revelaing the thoughts that lead to the content filter:

    const filter = t => t?.split('\n').filter(l => !l.includes('content_filter')).join('\n');

    ['response', 'responseText'].forEach(prop => {
      const orig = Object.getOwnPropertyDescriptor(XMLHttpRequest.prototype, prop);
      Object.defineProperty(XMLHttpRequest.prototype, prop, {
        get: function() { return filter(orig.get.call(this)); }
      });
    });
Paste the above in the browser console ^
replies(2): >>42891427 #>>42891516 #
tills13 ◴[] No.42891516[source]
insane that this is client-side.
replies(8): >>42891775 #>>42891802 #>>42892213 #>>42892242 #>>42892457 #>>42896609 #>>42896617 #>>42896757 #
switch007 ◴[] No.42896609[source]
Lots of us have seen way worse hah

Such as client side control of prices when placing an order

replies(1): >>42897164 #
dkga ◴[] No.42897164[source]
Client-side because it reacts to local cookies?
replies(2): >>42897516 #>>42897557 #
1. switch007 ◴[] No.42897557[source]
Ah yeah the particular instance I was thinking of was a backend problem technically. The frontend just happened to make it really obvious as it would POST a JSON body with a "price" key