chavyleung / chavyleung/scripts

[Env.js] 有考虑增加更多兼容处理吗?

Open
#523 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
5.5k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

目前我观察到两点值得改进的

  1. 添加 $.request$.response 用以处理不同工具 headers 的 key 大小写不同的问题。例如 Loon 都是小写,而 QX 是大小写都有。以及 $request.status$request.statusCode$request.path等差异字段。
  2. $.done() 方法在请求阶段返回虚假响应时,不同工具需要传入的参数不同。例如 Loon$.done({response: {status: 302}}),而 QX$.done({status: "HTTP/1.1 302 Found"})。在响应阶段修改响应时,Loon$.done({status: 200}),而 QX$.done({status: "HTTP/1.1 200 OK"})

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading Env.js and trace the existing $.done() handling and request/response fields. Compare the Loon and QX forms described in the issue; done should provide compatible request and response aliases and accept the documented status formats across both tools.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.