mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-07 04:52:47 +08:00
fix #1240: losing host port in har2case
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
- feat: add builtin function `environ`/`ENV`
|
||||
- fix: demo function compatibility
|
||||
- fix #1240: losing host port in har2case
|
||||
- change: get hrp version from aliyun OSS file when installing
|
||||
|
||||
## v4.0.0-beta (2022-04-24)
|
||||
|
||||
@@ -187,7 +187,7 @@ func (s *tStep) makeRequestURL(entry *Entry) error {
|
||||
log.Error().Err(err).Msg("make request url failed")
|
||||
return err
|
||||
}
|
||||
s.Request.URL = fmt.Sprintf("%s://%s", u.Scheme, u.Hostname()+u.Path)
|
||||
s.Request.URL = fmt.Sprintf("%s://%s", u.Scheme, u.Host+u.Path)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -142,6 +142,23 @@ func TestGetFilenameWithoutExtension(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestMakeRequestURL(t *testing.T) {
|
||||
har := NewHAR("")
|
||||
entry := &Entry{
|
||||
Request: Request{
|
||||
URL: "http://127.0.0.1:8080/api/login",
|
||||
},
|
||||
}
|
||||
step, err := har.prepareTestStep(entry)
|
||||
if !assert.NoError(t, err) {
|
||||
t.Fatal()
|
||||
}
|
||||
|
||||
if !assert.Equal(t, "http://127.0.0.1:8080/api/login", step.Request.URL) {
|
||||
t.Fatal()
|
||||
}
|
||||
}
|
||||
|
||||
func TestMakeRequestHeaders(t *testing.T) {
|
||||
har := NewHAR("")
|
||||
entry := &Entry{
|
||||
|
||||
Reference in New Issue
Block a user