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

Proposal for calling head method #491

Open
kevin19930919 opened this issue Oct 18, 2024 · 1 comment
Open

Proposal for calling head method #491

kevin19930919 opened this issue Oct 18, 2024 · 1 comment
Assignees

Comments

@kevin19930919
Copy link

We find that when we try to fetch large file content with API GET https://api-data.line.me/v2/bot/message/{messageId}/content, the connection will be closed by line client when it exceed 100s.
Then we get response like:

HTTP/2 stream 1 was not closed cleanly: INTERNAL_ERROR (err 2)

I use curl to get the complete information:

Note: Unnecessary use of -X or --request, GET is already inferred.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:02 --:--:--     0*   Trying 147.92.191.80:443...
* Connected to api-data.line.me (147.92.191.80) port 443 (#0)
* ALPN: offers h2,http/1.1
* (304) (OUT), TLS handshake, Client hello (1):
} [321 bytes data]
*  CAfile: /etc/ssl/cert.pem
*  CApath: none
* (304) (IN), TLS handshake, Server hello (2):
{ [122 bytes data]
* (304) (IN), TLS handshake, Unknown (8):
{ [19 bytes data]
* (304) (IN), TLS handshake, Certificate (11):
{ [2731 bytes data]
* (304) (IN), TLS handshake, CERT verify (15):
{ [264 bytes data]
* (304) (IN), TLS handshake, Finished (20):
{ [52 bytes data]
* (304) (OUT), TLS handshake, Finished (20):
} [52 bytes data]
* SSL connection using TLSv1.3 / AEAD-AES256-GCM-SHA384
* ALPN: server accepted h2
* Server certificate:
*  subject: C=JP; ST=Tokyo; L=Chiyoda-ku; O=LY Corporation; CN=*.line.me
*  start date: Aug  8 04:31:02 2024 GMT
*  expire date: Sep  9 04:31:01 2025 GMT
*  subjectAltName: host "api-data.line.me" matched cert's "*.line.me"
*  issuer: C=BE; O=GlobalSign nv-sa; CN=GlobalSign RSA OV SSL CA 2018
*  SSL certificate verify ok.
* using HTTP/2
* h2h3 [:method: GET]
* h2h3 [:path: /v2/bot/message/xxxxxx/content]
* h2h3 [:scheme: https]
* h2h3 [:authority: api-data.line.me]
* h2h3 [accept: */*]
* h2h3 [authorization: Bearer xxxxxx]
* h2h3 [user-agent: insomnia/10.1.0]
* Using Stream ID: 1 (easy handle 0x13e80a800)
> GET /v2/bot/message/xxxx/content HTTP/2
> Host: api-data.line.me
> accept: */*
> authorization: Bearer xxxxxx
> user-agent: insomnia/10.1.0
>
< HTTP/2 200
< server: openresty
< date: Fri, 18 Oct 2024 13:35:09 GMT
< content-type: application/postscript
< content-length: 445151017
< accept-ranges: bytes
< cache-control: max-age=86400
< expires: Sat, 19 Oct 2024 13:35:08 GMT
< x-content-type-options: nosniff
< last-modified: Fri, 18 Oct 2024 08:15:12 GMT
< x-line-request-id: b9fe8504-467b-d511-89ea-d377efeb40b3
<
{ [16127 bytes data]
 23  424M   23  101M    0     0  1017k      0  0:07:07  0:01:42  0:05:25 1035k* HTTP/2 stream 1 was not closed cleanly: INTERNAL_ERROR (err 2)
 23  424M   23  101M    0     0  1017k      0  0:07:07  0:01:42  0:05:25 1050k
* Connection #0 to host api-data.line.me left intact
curl: (92) HTTP/2 stream 1 was not closed cleanly: INTERNAL_ERROR (err 2)

We would like to get the file size by calling HEAD method at 1st, so we can decided our next step.
Can we have a head method at linebot/client.go? If it's ok, I would love to add it.

System Informations

  • Go version: 1.22
  • OS: macOS

Expected Behavior

Current Behavior

Steps to Reproduce

Logs

@habara-k habara-k added the keep label Oct 22, 2024
@habara-k habara-k self-assigned this Oct 22, 2024
@habara-k
Copy link
Contributor

Thank you for using the line-bot-sdk-go.
Currently, the connection may be cut off due to server-side timeouts depending on the response size.

We would like to get the file size by calling the HEAD method first, so we can decide our next step.

Could you please let us know specifically what you aim to achieve by obtaining the file size?

@Yang-33 Yang-33 removed the bug label Nov 6, 2024
@Yang-33 Yang-33 removed the keep label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants