Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work-around for *request* issue #1839

Merged
merged 1 commit into from
Sep 29, 2021

Conversation

Martii
Copy link
Member

@Martii Martii commented Sep 29, 2021

Not entirely sure what is happening here yet. There is a 2nd http/2 request to GH to pull the favicon.ico and it results in a 400 code which might be affecting request.

GET https://raw.githubusercontent.com/thoughtsunificator/anime-twist-premium-extension/master/public/resource/icon192.png
[HTTP/2 304 Not Modified 41ms]

GET https://raw.githubusercontent.com/favicon.ico
[HTTP/2 400 Bad Request 0ms]


GET
	https://raw.githubusercontent.com/favicon.ico
Status
400
Bad Request
VersionHTTP/2
Transferred20 B (20 B size)
Referrer Policystrict-origin-when-cross-origin


    HTTP/2 400 Bad Request

    content-security-policy: default-src 'none'; style-src 'unsafe-inline'; sandbox
    strict-transport-security: max-age=31536000
    x-content-type-options: nosniff
    x-frame-options: deny
    x-xss-protection: 1; mode=block
    content-type: text/plain; charset=utf-8
    x-github-request-id: BFCA:398E:20EA4:2B1D1:6154C049
    accept-ranges: bytes
    date: Wed, 29 Sep 2021 19:36:41 GMT
    via: 1.1 varnish
    x-served-by: *clipped*
    x-cache: MISS
    x-cache-hits: 0
    x-timer: S1632944201.991904,VS0,VE55
    vary: Authorization,Accept-Encoding,Origin
    access-control-allow-origin: *
    x-fastly-request-id: 6430a82547959939007b65990d31d046decc784d
    expires: Wed, 29 Sep 2021 19:41:41 GMT
    content-length: 20
    X-Firefox-Spdy: h2
    Accept
    	image/webp,*/*
    Accept-Encoding
    	gzip, deflate, br
    Accept-Language
    	en-US,en;q=0.5
    Connection
    	keep-alive
    DNT
    	1
    Host
    	raw.githubusercontent.com
    Referer
    	https://raw.githubusercontent.com/thoughtsunificator/anime-twist-premium-extension/master/public/resource/icon192.png
    Sec-Fetch-Dest
    	image
    Sec-Fetch-Mode
    	no-cors
    Sec-Fetch-Site
    	same-origin
    Sec-GPC
    	1
    User-Agent
    	Mozilla/5.0 (X11; Linux x86_64; rv:92.0) Gecko/20100101 Firefox/92.0

See also:


Btw this results in a server trip without this of:

Error: Callback was already called.
    at ~/repo/git/OpenUserJS.org/martii/OpenUserJS.org/node_modules/async/dist/async.js:321:36
    at ~/repo/git/OpenUserJS.org/martii/OpenUserJS.org/node_modules/async/dist/async.js:3643:17
    at Request.<anonymous> (~/repo/git/OpenUserJS.org/martii/OpenUserJS.org/controllers/scriptStorage.js:1625:17)
    at Request.emit (node:events:406:35)
    at Request.emit (node:domain:475:12)
    at IncomingMessage.<anonymous> (~/repo/git/OpenUserJS.org/martii/OpenUserJS.org/node_modules/request/request.js:1076:12)
    at Object.onceWrapper (node:events:513:28)
    at IncomingMessage.emit (node:events:406:35)
    at IncomingMessage.emit (node:domain:475:12)
    at IncomingMessage.<anonymous> (~/repo/git/OpenUserJS.org/martii/OpenUserJS.org/node_modules/request/request.js:993:23)
    at IncomingMessage.emit (node:events:406:35)
    at IncomingMessage.emit (node:domain:475:12)
    at emitCloseNT (node:internal/streams/destroy:138:10)
    at emitErrorCloseNT (node:internal/streams/destroy:123:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)

Affects at least:

  • Mozilla/5.0 (X11; Linux x86_64; rv:92.0) Gecko/20100101 Firefox/92.0 (Gecko)
  • Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36 (Chromium)

Working url: https://raw.githubusercontent.com/Martii/UserScripts/master/res/world.png
Non-working url: https://raw.githubusercontent.com/thoughtsunificator/anime-twist-premium-extension/master/public/resource/icon256.png

Header Response difference (non-working):

    TE
    	trailers

... Ref https://developer.mozilla.org/docs/Web/HTTP/Headers/TE


Assumption: I think that the req.abort() occasionally generates ECONNRESET even though the @icon was sufficiently chunked and processed with its callback. Poking around the node source the methodology in this PR appears to be what they are doing a lot of the time. i.e. // fallsthrough. I now don't think it's a browser issue... still could be a dep issue but more likely it's a "feature" that was cleaned up in later node upgrades.

Not entirely sure what is happening here yet. There is a 2nd http/2 request to GH to pull the favicon.ico and it results in a 400 code which might be affecting *request*.

``` console
GET https://raw.githubusercontent.com/thoughtsunificator/anime-twist-premium-extension/master/public/resource/icon192.png
[HTTP/2 304 Not Modified 41ms]

GET https://raw.githubusercontent.com/favicon.ico

GEThttps://raw.githubusercontent.com/favicon.ico
[HTTP/2 400 Bad Request 0ms]


GET
	https://raw.githubusercontent.com/favicon.ico
Status
400
Bad Request
VersionHTTP/2
Transferred20 B (20 B size)
Referrer Policystrict-origin-when-cross-origin


    HTTP/2 400 Bad Request

    content-security-policy: default-src 'none'; style-src 'unsafe-inline'; sandbox
    strict-transport-security: max-age=31536000
    x-content-type-options: nosniff
    x-frame-options: deny
    x-xss-protection: 1; mode=block
    content-type: text/plain; charset=utf-8
    x-github-request-id: BFCA:398E:20EA4:2B1D1:6154C049
    accept-ranges: bytes
    date: Wed, 29 Sep 2021 19:36:41 GMT
    via: 1.1 varnish
    x-served-by: *clipped*
    x-cache: MISS
    x-cache-hits: 0
    x-timer: S1632944201.991904,VS0,VE55
    vary: Authorization,Accept-Encoding,Origin
    access-control-allow-origin: *
    x-fastly-request-id: 6430a82547959939007b65990d31d046decc784d
    expires: Wed, 29 Sep 2021 19:41:41 GMT
    content-length: 20
    X-Firefox-Spdy: h2
    Accept
    	image/webp,*/*
    Accept-Encoding
    	gzip, deflate, br
    Accept-Language
    	en-US,en;q=0.5
    Connection
    	keep-alive
    DNT
    	1
    Host
    	raw.githubusercontent.com
    Referer
    	https://raw.githubusercontent.com/thoughtsunificator/anime-twist-premium-extension/master/public/resource/icon192.png
    Sec-Fetch-Dest
    	image
    Sec-Fetch-Mode
    	no-cors
    Sec-Fetch-Site
    	same-origin
    Sec-GPC
    	1
    User-Agent
    	Mozilla/5.0 (X11; Linux x86_64; rv:92.0) Gecko/20100101 Firefox/92.0
```

See also:
* https://openuserjs.org/discuss/Changing_my_linked_git_hub_account#comment-17c32e96846
* OpenUserJS#1722
@Martii Martii added bug You've guessed it... this means a bug is reported. needs mitigation Needs additional followup. dependency issue Hmmph! A dependency issue browser issue Surprise! It's a browser issue. labels Sep 29, 2021
@Martii Martii merged commit 7a2f3d6 into OpenUserJS:master Sep 29, 2021
@Martii Martii deleted the iconValidationWorkaround branch September 29, 2021 20:14
@Martii Martii removed browser issue Surprise! It's a browser issue. needs mitigation Needs additional followup. labels Oct 5, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug You've guessed it... this means a bug is reported. dependency issue Hmmph! A dependency issue
Development

Successfully merging this pull request may close these issues.

1 participant