langgenius / langgenius/dify

Web reader rejects pages that do not support HEAD requests

Open
#42,237 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
156k
Forks
24.6k
Avg merge
22h 9m
Merged PRs (30d)
610

Description

## Description

The web reader probes a URL with `HEAD` before fetching its content. If the server returns `405 Method Not Allowed` or `501 Not Implemented` for `HEAD`, the reader returns that status immediately even when a normal `GET` succeeds.

## Reproduction

For a page where:

- `HEAD /page` returns 405
- `GET /page` returns 200 with HTML

`get_url()` returns:

```text
URL returned status code 405.
```

I reproduced this twice on current `main` with a stubbed transport. Both runs returned the same result.

## Expected behavior

When the server explicitly does not support `HEAD`, the reader should fall back to `GET` and process the successful response. Other error statuses should keep their current behavior.

Contributor guide

Open the contributing guide

Research direction

Start at the get_url() entry point and trace the HEAD probe through the stubbed transport reproduction. Verify the behavior for HEAD responses 405 and 501, then confirm that a successful GET is processed while other error statuses retain their current behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.