TNG / if-webpage-plugins

Impact Framework Plugins for Webpage Measurement (CommonJS)
Apache License 2.0
5 stars 0 forks source link

handle potential preflight requests #4

Closed alexzurbonsen closed 7 months ago

alexzurbonsen commented 8 months ago

At some point I ran into errors with certain requests, that were probably preflight requests Back then it was on www.tagesschau.de.

Error message: ProtocolError: Could not load body for this request. This might happen if the request is a preflight request.

Handled them by adding an if statement with these conditions in the responseHandler

      response.status() !== 204 &&
      response.status() !== 304 &&
      response.request().method() !== 'OPTIONS'

Understand if there is a better solution.