Skip to content

Commit

Permalink
Merge pull request #162 from AElfProject/feature/node-fetch
Browse files Browse the repository at this point in the history
feature/node fetch
  • Loading branch information
hzz780 authored Jun 21, 2024
2 parents daf1677 + 1838db3 commit 5e21556
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 44 deletions.
55 changes: 25 additions & 30 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,33 @@
---
name: Bug report
about: Create a report to help us improve
name: 👾 Bug Report
about: Report a bug or issue with the project.
title: ''
labels: ''
labels: 'bug'
assignees: ''

---

**Describe the bug**
### Description
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
### Steps To Reproduce
1. Log in...
2. Ensure that...
3. Allow a long period of inactivity to pass...
4. Observe that...
5. Attempt to log in...

### Current Behavior
- After the period of inactivity...
- When the user tries to log in using another method...
- This causes a bug due to...

### Expected Behavior
- After a long period of inactivity...
- When a user logs in successfully...
- This ensures that only...

### Environment
- Platform: PC
- Node: v18.18.0
- Browser: Chrome 126.0.6478.56
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
blank_issues_enabled: false
issue_template:
- name: 👾 Bug Report
description: Report a bug or issue with the project.
labels: ["bug"]
template: bug_report.md
- name: 💡 Feature Request
description: Create a new ticket for a new feature request.
labels: ["enhancement"]
template: feature_request.md
29 changes: 18 additions & 11 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
---
name: Feature request
about: Suggest an idea for this project
name: 💡 Feature Request
about: Create a new ticket for a new feature request
title: ''
labels: ''
labels: 'enhancement'
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
### Expected Behavior
Describe the expected behavior here.

**Describe the solution you'd like**
A clear and concise description of what you want to happen.
### Specifications
As a `user`, I would like to `action` so that `reason`.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Features:**
- describe feature details here.

**Additional context**
Add any other context or screenshots about the feature request here.
**Development Tasks:**
- [ ] Task 1
- [ ] Task 2

### Dependencies
List any dependencies that are required for this feature by providing links to the issues or repositories.

### References
List any references that are related to this feature request.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 AElfProject
Copyright (c) 2024 AElfProject

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions src/util/httpProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (process.env.RUNTIME_ENV === 'browser') {
} else {
// For node use xmlhttprequest
// eslint-disable-next-line global-require
RequestLibrary = require('xmlhttprequest').XMLHttpRequest;
RequestLibraryXMLOnly = require('xmlhttprequest').XMLHttpRequest;
// eslint-disable-next-line global-require
RequestLibrary = require('node-fetch');
isFetch = true;
Expand Down Expand Up @@ -210,7 +210,7 @@ export default class HttpProvider {
}

sendAsyncByXMLHttp(requestConfig) {
const request = new RequestLibrary();
const request = RequestLibraryXMLOnly ? new RequestLibraryXMLOnly() : new RequestLibrary();
request.withCredentials = false;
request.timeout = this.timeout;
this.requestSend(requestConfig, request, true);
Expand Down

0 comments on commit 5e21556

Please sign in to comment.