Skip to content

Conversation

@feitian124
Copy link
Contributor

try fix #164
the default sails http middleware seems not work with 'text/xml' post request well and result error in req, which not fire load function at all.

after debug, there are two way to fix this:

  1. parser req.weixin in a middleware before invoke wechat, since wechat will use it directly if find it.
  2. override sails body-parse using express-xml-bodyparser then use the result in load.

this PR implement 2.

thanks.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.27%) to 91.69% when pulling 903d212 on feitian124:master into 199cdfa on node-webot:master.

lib/wechat.js Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该是判断到rawBody存在以后,就不要去侦听data和end事件了

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

恩,貌似更合理一点,我去改下。

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.56%) to 91.4% when pulling 7e20aa2 on feitian124:master into 199cdfa on node-webot:master.

@feitian124
Copy link
Contributor Author

想加一个测试, 按照 supertest 的文档, 应该是可以直接 post joson 的, 但我在这里试了下最简单的例子也不行,先注释掉测试了, 有空帮看看。

@JacksonTian
Copy link
Member

landed in 187b0e2

@JacksonTian JacksonTian closed this May 3, 2015
@JacksonTian
Copy link
Member

1.2.5 published

@feitian124
Copy link
Contributor Author

good, thanks.

@JacksonTian
Copy link
Member

能分享下 rails下的接入形式么。

@feitian124
Copy link
Contributor Author

rails? 我是 sails。。

@JacksonTian
Copy link
Member

sails。嗯。说错。

@feitian124
Copy link
Contributor Author

YunnuY/sweat#1

上面咯,正好有个 issue 没搞定, 是不是 js 里面的 this 上下文不对引起? ^ ^

@JacksonTian
Copy link
Member

对sails结构不太熟。详细引用有吗

@feitian124
Copy link
Contributor Author

详细引用? 不太懂你什么意思.
sails 是基于 expressjs 仿 rails 的一个框架吧, 还挺方便的.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

用 sails 使用wechat ,读不到流

3 participants