Skip to content

Commit

Permalink
fix(undios): ws() should be sync
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Feb 22, 2024
1 parent 306e721 commit f94a7fb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,7 @@ export class HTTP extends Service<HTTP.Config> {
}

// we don't use `raw.ok` because it may be a 3xx redirect
const leading = raw.status.toString().charAt(0)
if (leading !== '2' && leading !== '3') {
if (raw.status >= 400) {
const error = new HTTP.Error(raw.statusText)
error.response = response
try {
Expand Down Expand Up @@ -319,7 +318,7 @@ export class HTTP extends Service<HTTP.Config> {
}
}

async ws(this: HTTP, url: string | URL, init?: HTTP.Config) {
ws(this: HTTP, url: string | URL, init?: HTTP.Config) {
const caller = this[Context.trace]
const config = this.resolveConfig(init)
url = this.resolveURL(url, config)
Expand Down

0 comments on commit f94a7fb

Please sign in to comment.