1
向Bugsnag Enterprise發出標準bugsnag請求時,Chrome向我顯示該請求已被具有405響應狀態的服務器拒絕。Bugsnag JS正在提出Bugsnag Enterprise不支持的請求
Request Method:GET
Status Code:405 Method Not Allowed
這裏是我的代碼:
const script_tag = document.createElement('script');
script_tag.setAttribute('src', '//d2wy8f7a9ursnm.cloudfront.net/bugsnag-3.min.js');
document.head.appendChild(script_tag);
script_tag.onload =() => {
Bugsnag.apiKey = BUGSNAG_API_KEY;
Bugsnag.endpoint = '//exceptions.my-domain.com';
Bugsnag.notifyHandler = 'xhr';
const e = new Error('Test error!');
Bugsnag.notifyException(e);
}
(插入標籤時,我沒有使用像data-apikey="..."
Bugsnag的data
屬性的原因是因爲從bugsnag警告的結果:[Bugsnag] Invalid API key 'undefined'
,但是這是一個單獨的問題...)
Bugsnag API docs說應該通過POST請求發送錯誤,所以我不知道爲什麼Bugsnag自己的Javascript庫會發出GET請求。
我該如何解決這個問題?