addyosmani / addyosmani/critical

Set headers or Cookies for request in CLI

Đang mở
#596 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
awaiting reply
Ngôn ngữ chính
JavaScript
Star
10.3k
Fork
390
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hi,
I'm trying to generate critical css for a url that needs a specific cookie to be accessible. I'm working with the CLI since my project is not based on node. It seems like it might be possible to send the right headers with the cli but I'm not sure exact options I should use. I've tried:
```
DEBUG="critical:*" critical 'https://www.example.com/' --request-headers 'cookie: key=value;'
```
But it fails with:
```
Error: Expected value which is `plain object`, received value of type `string`.
```
Full debug shows:
```
Fetching resource: https://www.example.com/ {
headers: 'cookie: key=value;',
method: 'head',
https: { rejectUnauthorized: true }
}
```
Obviously it's expecting headers to be an object and not a string but it seems impossible to make it an option just with cli options. Is there a trick to make it work?

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.